reference a class by string unity code example
Example: reference a class by string unity
using UnityEngine;
using System;
public string className;
public void AddClassToGameobject()
{
gameObject.AddComponent(Type.GetType(className));
}
using UnityEngine;
using System;
public string className;
public void AddClassToGameobject()
{
gameObject.AddComponent(Type.GetType(className));
}