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.
43 lines
1.5 KiB
43 lines
1.5 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 { IProp } from "../../Mgr_CSV/CsvEnum";
|
|
import { GameTotalType } from "../../const/GameEnum";
|
|
import { IData } from "../../const/GameInterface";
|
|
//#endregion 文件引入
|
|
const {ccclass, property,menu} = _decorator;
|
|
@ccclass("treasureItem_Proxy")
|
|
export default class treasureItem_Proxy extends UIParse{
|
|
//#region 节点自动生成
|
|
@property(Label)
|
|
lab_num: Label = null;
|
|
@property(Sprite)
|
|
spr_bg: Sprite = null;
|
|
@property(Sprite)
|
|
spr_icon: Sprite = null;
|
|
@property(Label)
|
|
lab_name: Label = null;
|
|
//#endregion 节点自动生成
|
|
|
|
onButtonClick(button:Button){
|
|
|
|
/**点击事件触发*/
|
|
switch (button) {
|
|
default:
|
|
ConsoleEx.Log(button);
|
|
break;
|
|
}
|
|
}
|
|
|
|
setData(cfg:IProp, isfree:boolean = false){
|
|
const iData:IData = {
|
|
type: GameTotalType.TREAS,
|
|
id: cfg.id,
|
|
num:0,
|
|
}
|
|
CNodeUtils.SwitchTextureByData(this.spr_icon, iData);
|
|
CNodeUtils.switchText(this.lab_num, isfree ? '免费' : cfg.price);
|
|
CNodeUtils.switchTextByQuality(this.lab_name, cfg.name, 5);
|
|
}
|
|
}
|