|
@@ -1,6 +1,6 @@
|
|
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
const { ccclass, property } = cc._decorator;
|
|
|
-import { OpenActionType, PanelType } from '../../mk/system/UISystem';
|
|
|
|
|
|
|
+import { OpenActionType } from '../../mk/system/UISystem';
|
|
|
/**
|
|
/**
|
|
|
* 打开指定名字的面板
|
|
* 打开指定名字的面板
|
|
|
* @author 薛鸿潇
|
|
* @author 薛鸿潇
|
|
@@ -8,12 +8,10 @@ import { OpenActionType, PanelType } from '../../mk/system/UISystem';
|
|
|
@ccclass
|
|
@ccclass
|
|
|
export default class BtnOpenPanel extends cc.Component {
|
|
export default class BtnOpenPanel extends cc.Component {
|
|
|
|
|
|
|
|
- @property({ displayName: '界面名字', tooltip: '对应路径:resources/prefab/uiPanel/' })
|
|
|
|
|
|
|
+ @property({ displayName: '预制体路径', tooltip: '对应路径:resources/' })
|
|
|
private panel_name = '';
|
|
private panel_name = '';
|
|
|
@property({ displayName: '打开类型', tooltip: 'normal不操作,closeOther关闭其他,closeLast关闭上一个', type: cc.Enum(OpenActionType) })
|
|
@property({ displayName: '打开类型', tooltip: 'normal不操作,closeOther关闭其他,closeLast关闭上一个', type: cc.Enum(OpenActionType) })
|
|
|
private open_type = OpenActionType.normal;
|
|
private open_type = OpenActionType.normal;
|
|
|
- @property({ displayName: '面板类型', tooltip: 'game游戏界面,module模块界面', type: cc.Enum(PanelType) })
|
|
|
|
|
- private panel_type = PanelType.module;
|
|
|
|
|
@property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
|
|
@property({ displayName: '完成回调', tooltip: "面板打开完成后触发", type: cc.Component.EventHandler })
|
|
|
public onComplete: cc.Component.EventHandler[] = [];
|
|
public onComplete: cc.Component.EventHandler[] = [];
|
|
|
|
|
|
|
@@ -26,7 +24,7 @@ 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.open_type);
|
|
|
const c_count = this.onComplete.length;
|
|
const c_count = this.onComplete.length;
|
|
|
for (let i = 0; i < c_count; i++) {
|
|
for (let i = 0; i < c_count; i++) {
|
|
|
if (this.onComplete[i].handler) this.onComplete[i].emit([])
|
|
if (this.onComplete[i].handler) this.onComplete[i].emit([])
|