35 lines
971 B
TypeScript
35 lines
971 B
TypeScript
import FGUtil from "../gear_2.3.4/fgui/FGUtil";
|
|
import SKUIUtil from "../gear_2.3.4/util/SKUIUtil";
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
export default class DecisiveBattle extends cc.Component {
|
|
/**
|
|
* 決戰長安單例實例
|
|
*/
|
|
public static Instance: DecisiveBattle = null;
|
|
|
|
/**
|
|
* 決戰長安面板
|
|
*/
|
|
battlePanel: fgui.GComponent = null;
|
|
|
|
onLoad() {
|
|
if (DecisiveBattle.Instance === null) {
|
|
DecisiveBattle.Instance = this;
|
|
} else {
|
|
this.destroy();
|
|
return;
|
|
}
|
|
}
|
|
|
|
openBattlePanel(list: any = [], selfInfo = null, refresh: Boolean = false) {
|
|
if (!this.battlePanel || (this.battlePanel && !this.battlePanel.node && !SKUIUtil.isValid(this.battlePanel.node))) {
|
|
this.battlePanel = FGUtil.create("main_ui", "debate_panel");
|
|
FGUtil.root().addChild(this.battlePanel);
|
|
this.battlePanel.makeFullScreen();
|
|
}
|
|
}
|
|
|
|
}
|