SamsaraGame/assets/Script/panel/Chat/ChatRoleTitleItem.ts

36 lines
691 B
TypeScript
Raw Normal View History

2025-04-24 17:03:28 +08:00
//已TS化測試無誤可刪除原JS代碼
import GameModel from "../../ts/core/GameModel";
import GameUtil from "../../ts/core/GameUtil";
const {ccclass, property} = cc._decorator;
@ccclass
export default class ChatAppelItem extends cc.Component {
@property(cc.Label)
nameLab: cc.Label = null;
itemInfo :any =null;
onLoad() {
}
loadInfo(info:any) {
this.itemInfo = info;
this.itemInfo.type = 5;
this.nameLab.string = info.name;
}
mCallback: any;
setCallback(callback) {
this.mCallback = callback;
}
onPetClick() {
if(this.mCallback){
this.mCallback(this.itemInfo);
}
}
}