//外面接收克隆对象的模板
public GameObject prefabObj;
// Use this for initialization
void Start () {
for (int i = 0; i < 5; i++)
{
//克隆复制操作
//后面我们需要转为GameObject格式,否则格式不同无法工作
GameObject table = GameObject.Instantiate(prefabObj, new Vector3(2*i, 0, 0), Quaternion.identity) as GameObject;
}
}
Unity克隆游戏对象
最新推荐文章于 2024-09-13 19:08:05 发布