Explorar o código

界面关闭回调

薛鸿潇 %!s(int64=5) %!d(string=hai) anos
pai
achega
55b06e61c4
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      mk_framework/assets/script/mk/system/UISystem.ts

+ 5 - 3
mk_framework/assets/script/mk/system/UISystem.ts

@@ -122,15 +122,17 @@ export default class UISystem extends cc.Component {
         // 是否存在关闭动画
         let comp_anim = node_panel.getComponent('UIOpenAndClose');
         if (comp_anim) {
-            comp_anim.hideEffect(this.destroyNode.bind(this, node_panel, panelName));
+            comp_anim.hideEffect(this.destroyNode.bind(this, node_panel, panelName, callBack));
         } else {
-            this.destroyNode(node_panel, panelName);
+            this.destroyNode(node_panel, panelName, callBack);
         }
     }
-    private destroyNode(node_panel, panelName) {
+
+    private destroyNode(node_panel, panelName, callBack) {
         node_panel.destroy();
         delete this.curOnPanelDic[panelName];
         this.isPanelClosing = false;
+        callBack && callBack();
     }
 
     /**