Administrator 2024-05-29 游戏学习 2599
Cocos Creator 3.8 实例化预制体
createEgg(){
const randomNum = Math.floor(Math.random() * 5)
// 实例化预制体
const egg = instantiate(this.eggPrefab)
this.eggRoot.addChild(egg)
egg.setPosition(this.henPosArr[randomNum],460)
}