📅  最后修改于: 2022-03-11 14:48:56.442000             🧑  作者: Mango
using UnityEngine;
using System;
public string className;
public void AddClassToGameobject()
{
gameObject.AddComponent(Type.GetType(className));
}