Explorar o código

[FC]:UISystem panelParent保护处理

fengcong %!s(int64=5) %!d(string=hai) anos
pai
achega
53b84ad7be
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      mk_framework/assets/script/mk/system/UISystem.ts

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

@@ -34,7 +34,7 @@ export default class UISystem extends cc.Component {
      * @param openAction 打开之后的操(需不需要关闭其他界面)
      */
     openPanel(panelName: string, openAction: OpenActionType = OpenActionType.normal): Promise<any> {
-       
+
         let self = this;
         if (self.isPanelOpening || self.getCurOnPanel(panelName)) {
             return;
@@ -57,6 +57,10 @@ export default class UISystem extends cc.Component {
                         return;
                     }
 
+                    if (self.panelParent) {
+                        self.panelParent = self.node;
+                    }
+
                     self.panelParent.addChild(node_panel);
 
                     switch (openAction) {