From c5a13ab7bb643e0fef9d901b1c07d77ae4bb7ab8 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 22 Apr 2025 17:00:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9GUI=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E7=9A=84onRemoved=E4=BA=8B=E4=BB=B6=E5=9C=A8=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=88=B6=E8=8A=82=E7=82=B9=E6=97=B6=E8=A7=A6?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/gui/layer/DelegateComponent.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/core/gui/layer/DelegateComponent.ts b/assets/core/gui/layer/DelegateComponent.ts index 0d54119..43b6c5e 100644 --- a/assets/core/gui/layer/DelegateComponent.ts +++ b/assets/core/gui/layer/DelegateComponent.ts @@ -100,11 +100,12 @@ export class DelegateComponent extends Component { else { this.node.removeFromParent(); } + + // 触发窗口组件上窗口移除之后的事件 + this.applyComponentsFunction(this.node, EventOnRemoved, this.vp.params); } onDestroy() { - // 触发窗口组件上窗口移除之后的事件 - this.applyComponentsFunction(this.node, EventOnRemoved, this.vp.params); this.vp = null!; }