From 63b85a0aa88aeab5e4115c6ff185dbb92323df3f Mon Sep 17 00:00:00 2001 From: donggang <> Date: Mon, 11 Mar 2024 15:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/module/common/GameComponent.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/module/common/GameComponent.ts b/assets/module/common/GameComponent.ts index fc30001..1cd8e43 100644 --- a/assets/module/common/GameComponent.ts +++ b/assets/module/common/GameComponent.ts @@ -230,6 +230,9 @@ export class GameComponent extends Component { * Label2(event: EventTouch) { console.log(event.target.name); } */ protected setButton(...args: string[]) { + this.setButtonList(args); + } + protected setButtonList(args: string[]) { this.node.on(Node.EventType.TOUCH_END, (event: EventTouch) => { var self: any = this; var func = self[event.target.name]; @@ -249,6 +252,9 @@ export class GameComponent extends Component { * onGlobal(event: string, args: any) { console.log(args) }; */ protected setEvent(...args: string[]) { + this.setButtonList(args); + } + protected setEventList(args: string[]) { var self: any = this; for (const name of args) { var func = self[name];