📜  将游戏对象实例化为子对象 - C# 代码示例

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

代码示例2
// 1. create game object
// 2. set its transform.parent property
GameObject child = GameObject.Instantiate(MyPrefab);
child.transform.parent = this.gameObject.transform; //or whatever gameobj will be its parent