📌  相关文章
📜  unity c# 将游戏对象存储在数组中 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:12.155000             🧑  作者: Mango

代码示例1
private GameObject[] objects = GameObject.FindGameObjectsWithTag("mytag");
//Change private to public if you want it to be acessible from the inspector and other scripts.
//Add [HideInInspector] in front of public if you don't want it to be accessible in the inspector.

//Replace objects with the name of your array that is storing the GameObjects.

//Replace mytag with the tag you are looking for in the array.