📜  如何引用子对象 unity - C# 代码示例

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

代码示例1
private void Start()
    {
        parentObject = GameObject.Find("Parent");// The name of the parent object
        childObject = parentObject.transform.GetChild(0).gameObject; // the parent index (starting from 0)
    }