修改GUI窗口的onRemoved事件在节点移除父节点时触发

This commit is contained in:
dgflash
2025-04-22 17:00:48 +08:00
parent 5708c10f48
commit c5a13ab7bb

View File

@@ -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!;
}