RemoveModou.ts 477 B

1234567891011121314151617181920212223242526
  1. import BaseEvent from "./BaseEvent";
  2. const {ccclass, property} = cc._decorator;
  3. /**
  4. * 移除魔豆脚本
  5. * 如果已经有射手了
  6. */
  7. @ccclass
  8. export default class RemoveModou extends BaseEvent {
  9. @property({
  10. displayName: '解救伙伴后移除道具',
  11. })
  12. mPetId: number = 1;
  13. onLoad () {
  14. super.onLoad()
  15. let pet = this.ff.main.player.getPet(this.mPetId);
  16. if(pet){
  17. this.node.destroy()
  18. }
  19. }
  20. }