|
|
@@ -19,11 +19,11 @@ export default class UISystem extends cc.Component {
|
|
|
private curOnPanelDic: { [key: string]: cc.Node } = {};
|
|
|
/** 上一个打开的界面名称 */
|
|
|
private lastOpenPanelName: string = "";
|
|
|
-
|
|
|
+
|
|
|
onLoad() {
|
|
|
mk.ui = this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
start() {
|
|
|
if (!this.panelParent) {
|
|
|
this.panelParent = this.node;
|
|
|
@@ -113,9 +113,18 @@ export default class UISystem extends cc.Component {
|
|
|
this.isPanelClosing = true;
|
|
|
|
|
|
let node_panel = this.getCurOnPanel(panelName);
|
|
|
+
|
|
|
+ // 是否存在关闭动画
|
|
|
+ let comp_anim = node_panel.getComponent('UIOpenAndClose');
|
|
|
+ if (comp_anim) {
|
|
|
+ comp_anim.hideEffect(this.destroyNode.bind(this, node_panel, panelName));
|
|
|
+ } else {
|
|
|
+ this.destroyNode(node_panel, panelName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private destroyNode(node_panel, panelName) {
|
|
|
node_panel.destroy();
|
|
|
delete this.curOnPanelDic[panelName];
|
|
|
-
|
|
|
this.isPanelClosing = false;
|
|
|
}
|
|
|
}
|