guoqing.zhu 8c5274d7ee update
2022-06-14 18:09:12 +08:00

40 lines
1.1 KiB
TypeScript

import { QualityStar } from '../UI/QualityStar';
import { UIBase } from '../UI/UIBase';
const { ccclass, property } = cc._decorator;
@ccclass
export class UpFail extends UIBase {
public static prefabPath = 'prefabs/UIPrefab/pb_herofail';
@property(cc.Node) beforeNode: cc.Node = null;
@property(cc.Label) lb_lv: cc.Label = null;
@property(cc.Label) lb_hp: cc.Label = null;
@property(cc.Label) lb_atk: cc.Label = null;
@property(cc.Label) lb_def: cc.Label = null;
@property(cc.Label) lb_lucky: cc.Label = null;
@property(cc.Label) lb_adv: cc.Label = null;
@property(QualityStar) oldStar: QualityStar = null;
@property(QualityStar) newStar: QualityStar = null;
init(data: any) {
console.log(JSON.stringify(data));
this.beforeNode.getComponent('herochoseone').initdata();
this.lb_hp.string = data.old_hero.hp;
this.lb_atk.string = data.old_hero.atk;
this.lb_def.string = data.old_hero.def;
this.lb_lucky.string = data.old_hero.lucky;
this.lb_adv.string = data.old_hero.advanced_count;
this.oldStar.initStar(data.old_hero.quality);
this.newStar.initStar(data.new_hero.quality);
}
onClose() {
this.node.destroy();
}
}