38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { UIBase } from '../UIBase';
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export class UIUpdateHero extends UIBase {
|
|
public static prefabPath = 'prefabs/UIPrefab/UI_UpdateHero';
|
|
|
|
@property(cc.Node) updateNode: cc.Node = null;
|
|
@property(cc.Node) advanceNode: cc.Node = null;
|
|
|
|
@property(cc.Node) leftBtn: cc.Node = null;
|
|
|
|
init(data: any) {
|
|
if (data['current'] == 'advance') {
|
|
this.updateNode.active = false;
|
|
this.advanceNode.active = true;
|
|
this.leftBtn.children[0].getComponent(cc.Toggle).isChecked = false;
|
|
this.leftBtn.children[1].getComponent(cc.Toggle).isChecked = true;
|
|
}
|
|
}
|
|
|
|
onClickUpdate() {
|
|
this.updateNode.active = true;
|
|
this.advanceNode.active = false;
|
|
}
|
|
|
|
onClickAdvance() {
|
|
this.updateNode.active = false;
|
|
this.advanceNode.active = true;
|
|
}
|
|
|
|
onClose() {
|
|
this.node.destroy();
|
|
cc.loader.releaseRes(UIUpdateHero.prefabPath);
|
|
}
|
|
}
|