Просмотр исходного кода

[FC]:UISystem panelParent保护处理

fengcong 5 лет назад
Родитель
Сommit
53b84ad7be
1 измененных файлов с 5 добавлено и 1 удалено
  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) {