using UnityEngine; using System; public string className; public void AddClassToGameobject() { gameObject.AddComponent(Type.GetType(className)); }