浏览代码

注销事件添加

woso_javan 3 月之前
父节点
当前提交
fdacf3a32d
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      assets/module_take_goblet/Script/LevelAction.ts

+ 7 - 0
assets/module_take_goblet/Script/LevelAction.ts

@@ -60,6 +60,7 @@ export class LevelAction extends Component {
     }
 
     unregisterListener() {
+        EventDispatcher.instance.off(GameEvent.EVENT_REFRESH_COLOR, this.generateOriginCups, this);
         EventDispatcher.instance.off(GameEvent.EVENT_CLICK_ORIGIN_CUP, this.handlePourOriginCup, this);
         EventDispatcher.instance.off(GameEvent.EVENT_ORIGIN_CUP_DESTROYED, this.spawnNewOriginCup, this);
         EventDispatcher.instance.off(GameEvent.EVENT_COCKTAIL_CUP_DESTROYED, this.handleCupDestroyed, this);
@@ -109,6 +110,12 @@ export class LevelAction extends Component {
     }
 
     private async generateOriginCups() {
+
+        if (this.isProcessing) {
+            tgxUITips.show('我知道你很急,但你先别急!');
+            return;
+        }
+
         const outCups = this.outArea.getCups() as Node[];
         const waitCups = this.waitArea.getCups() as Node[];