public GameObject[] gos;//创建数组 //foreach(数组类型 自定义数组昵称 in 数组){} foreach (GameObject go in gos) { Debug.Log(go); }
博客列表 >Unity3d遍历数组foreach
public GameObject[] gos;//创建数组 //foreach(数组类型 自定义数组昵称 in 数组){} foreach (GameObject go in gos) { Debug.Log(go); }