Rob*_*rto 12
foreach (Transform child in transform)
child.gameObject.SetActive(false);
Run Code Online (Sandbox Code Playgroud)
//Assuming parent is the parent game object
for(int i=0; i< parent.transform.childCount; i++)
{
var child = parent.transform.GetChild(i).gameObject;
if(child != null)
child.setActive(false);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13653 次 |
| 最近记录: |