MonoBehaviour parentcomp = obj.GetComponent<MonoBehaviour>();
MonoScript ms = MonoScript.FromMonoBehaviour(mb);
string scriptpath = AssetDatabase.GetAssetPath(ms);
string ext = Path.GetExtension(scriptpath);
if(ext == ".js")
{
...
}
else
{
....
}
如何判读unity挂载的脚本是javascript 还是CSharp
最新推荐文章于 2023-07-31 20:50:15 发布