大侠
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.
 
 
 

44 lines
1.7 KiB

//#region 文件引入
import { _decorator, Button, Component, Label, Node, sp, Sprite,Animation, RichText, SpriteFrame } from "cc";
import BaseUIForm from "../../Mgr_UI/BaseUIForm";
import UIParse from "../../Mgr_UI/UIParse";
import GDUtils from "../../ExCUtils/GDUtils";
import { GameTotalType, PropType } from "../../const/GameEnum";
import { Global } from "../../Global";
//#endregion 文件引入
const {ccclass, property,menu} = _decorator;
@ccclass("rewardItem_Proxy")
export default class rewardItem_Proxy extends UIParse{
//#region 节点自动生成
@property(Sprite)
spr_bg: Sprite = null;
@property(Sprite)
spr_pbg: Sprite = null;
@property(Sprite)
spr_icon: Sprite = null;
@property(Label)
lab_num: Label = null;
//#endregion 节点自动生成
@property({type:[SpriteFrame]})
protected mBgs: SpriteFrame[] = [];
@property({type:[SpriteFrame]})
protected mPBgs: SpriteFrame[] = [];
onButtonClick(button:Button){
/**点击事件触发*/
switch (button) {
default:
ConsoleEx.Log(button);
break;
}
}
setInfo(type:number, num:number){
const config = Global.CsvMgr.base_res_csv[type];
CNodeUtils.SwitchTexture(GDUtils.getUrl2(GameTotalType.TOKEN, type), this.spr_icon, GDUtils.getUBundle(GameTotalType.TOKEN));
CNodeUtils.switchText(this.lab_num, num);
this.spr_bg.spriteFrame = this.mBgs[config.quality - 1];
this.spr_pbg.spriteFrame = this.mPBgs[config.quality - 1];
}
}