原文:
GameObject.Find与Transform.Find的区别添加链接描述
-
GameObject.Find
函数原型:
public static GameObject Find(string name);
说明:- GameObject只能查找到active的物体
- 果name指定路径,则按路径查找;否则递归查找,直到查找到第一个符合条件的GameObject或者返回null
-
transform.Find
函数原型:
public Transform Find(string n);
说明:- transform.Find用于查找子节点,它并不会递归的查找物体,也就是说它只会查找它的子节点,并不会查找子节点的子节点。