Unity C# 根据string 来获取 类 组件

1. 可以根据 Type.GetType(" 类名"+","+"Dll名") dll名 不加后缀

可以获取 类

 

2. 如果是判断物体上有没有加载这个组件  可以用  gameObject.GetComponent("类名"); 

 

posted @ 2020-09-17 19:45  D个人笔记  阅读(1179)  评论(0编辑  收藏  举报