|
@@ -15,7 +15,7 @@ export default class BtnOpenPanel extends cc.Component {
|
|
|
@property({ displayName: '面板类型', tooltip: 'game游戏界面,module模块界面', type: cc.Enum(PanelType) })
|
|
@property({ displayName: '面板类型', tooltip: 'game游戏界面,module模块界面', type: cc.Enum(PanelType) })
|
|
|
private panel_type = PanelType.module;
|
|
private panel_type = PanelType.module;
|
|
|
@property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
|
|
@property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
|
|
|
- public onComplete: cc.Component.EventHandler = new cc.Component.EventHandler();
|
|
|
|
|
|
|
+ public onComplete: cc.Component.EventHandler[] = [];
|
|
|
|
|
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
if (!this.node.getComponent(cc.Button)) this.node.addComponent(cc.Button);
|
|
if (!this.node.getComponent(cc.Button)) this.node.addComponent(cc.Button);
|
|
@@ -27,7 +27,10 @@ export default class BtnOpenPanel extends cc.Component {
|
|
|
|
|
|
|
|
private async openPanel() {
|
|
private async openPanel() {
|
|
|
await mk.ui.openPanel(this.panel_name, this.panel_type, this.open_type);
|
|
await mk.ui.openPanel(this.panel_name, this.panel_type, this.open_type);
|
|
|
- if (this.onComplete.handler) this.onComplete.emit([])
|
|
|
|
|
|
|
+ const c_count = this.onComplete.length;
|
|
|
|
|
+ for (let i = 0; i < c_count; i++) {
|
|
|
|
|
+ if (this.onComplete[i].handler) this.onComplete[i].emit([])
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// update (dt) {}
|
|
// update (dt) {}
|
|
|
}
|
|
}
|