Unity3d work log [Get objects in the scene]

【Drag directly】

1.public GameObject mObj;
2.[serialfield]
private GameObject mObj;


[code acquisition]

1. Through the name/tag of the object
2. Obtained through GameObject/transform
3. The obtained object is Active(false), the parent object is Active(true)
GameObject.Find("parent object name").gameObject.transform.Find(" The object name").gameObject; //SetActive(true)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325484092&siteId=291194637