开始多次碰撞只需要在if条件里再加个判断即可otherCollider.enabled 为true
来自课程:CocosCreator3.8入门教程-微信飞机大战
if (otherCollider.getComponent(Reward) && otherCollider.enabled) {//与奖励碰撞
otherCollider.enabled = false
otherCollider.getComponent(Sprite).enabled = false
const rewardType = otherCollider.getComponent(Reward).rewardType
switch (rewardType) {
case RewardType.TwoShoot:
this.shootType = ShootType.TwoShoot
this.unschedule(this.restOneShoot)
this.scheduleOnce(this.restOneShoot, 5)
break
case RewardType.Boom:
GameManager.instance.addBoom()
break
}
}
