//需要創建對象
GameObject prefab;
//創建對象的規定位置或父物體
Transform tr;
//創建出對象
Instantiate(prefab);
//創建對象,並設定位置和角度
Instantiate(prefab,tr.position,tr.rotation);
//是創建出來的對象是子對象
Instantiate(prefab,tr);
//需要創建對象
GameObject prefab;
//創建對象的規定位置或父物體
Transform tr;
//創建出對象
Instantiate(prefab);
//創建對象,並設定位置和角度
Instantiate(prefab,tr.position,tr.rotation);
//是創建出來的對象是子對象
Instantiate(prefab,tr);
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。