You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.5 KiB
38 lines
1.5 KiB
//#region 文件引入
|
|
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText, SpriteFrame, math } from "cc";
|
|
import UIParse from "../../Mgr_UI/UIParse";
|
|
import { RankData } from "../../const/GameInterface";
|
|
//#endregion 文件引入
|
|
const {ccclass, property,menu} = _decorator;
|
|
@ccclass("rankitem_Proxy")
|
|
export default class rankitem_Proxy extends UIParse{
|
|
//#region 节点自动生成
|
|
@property(Sprite)
|
|
spr_rank: Sprite = null;
|
|
@property(Label)
|
|
lab_rank: Label = null;
|
|
@property(Label)
|
|
lab_name: Label = null;
|
|
@property(Label)
|
|
lab_pass: Label = null;
|
|
//#endregion 节点自动生成
|
|
@property({type:[SpriteFrame]})
|
|
protected mRankBgs: SpriteFrame[] = [];
|
|
|
|
onButtonClick(button:Button){
|
|
|
|
/**点击事件触发*/
|
|
switch (button) {
|
|
default:
|
|
ConsoleEx.Log(button);
|
|
break;
|
|
}
|
|
}
|
|
|
|
setInfo(rankData:RankData){
|
|
CNodeUtils.switchText(this.lab_name,rankData.nickName);
|
|
CNodeUtils.switchText(this.lab_pass,rankData.passlv <= 21? rankData.passlv.toString() + '关':`全通${Math.floor(rankData.passlv/21)}次`);
|
|
CNodeUtils.switchText(this.lab_rank,rankData.rank.toString());
|
|
this.spr_rank.spriteFrame = rankData.rank <= 3?this.mRankBgs[rankData.rank - 1]:this.mRankBgs[3];
|
|
}
|
|
}
|