55 lines
1.3 KiB
JavaScript
55 lines
1.3 KiB
JavaScript
|
|
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
typeLab: cc.Label,
|
|
nameLabel: cc.Label,
|
|
|
|
nameTitleLabel: cc.Label,
|
|
nameInfoLabel: cc.Label,
|
|
descTitleLabel: cc.Label,
|
|
descInfoLabel: cc.Label,
|
|
},
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
onLoad () {
|
|
this.typearr = ['', '', '', '', '', '稱謂', '任務'];
|
|
},
|
|
|
|
loadInfo(info) {
|
|
this.iteminfo = info;
|
|
this.nameTitleLabel.node.active = true;
|
|
if(info.type == 5){ // 稱謂
|
|
this.nameLabel.string = info.name;
|
|
this.typeLab.string = '稱謂';
|
|
this.nameTitleLabel.node.active = false;
|
|
this.nameInfoLabel.string = info.name;
|
|
this.descTitleLabel.string = '【描述】';
|
|
this.descInfoLabel.string = info.desc;
|
|
}else if(info.type == 6){ // 任務
|
|
this.typeLab.string = '任務';
|
|
this.nameTitleLabel.string = '任務追踪';
|
|
this.descTitleLabel.string = '任務描述';
|
|
this.nameLabel.string = info.strTaskName;
|
|
|
|
let vecEventInfo = info.vecEvent[0];
|
|
let npcId = (vecEventInfo.vecNpc)[0];
|
|
let infoStr = vecEventInfo.strTip;
|
|
this.nameInfoLabel.string = npcId + "正在找我呢";
|
|
this.descInfoLabel.string = infoStr;
|
|
}
|
|
},
|
|
|
|
Close() {
|
|
this.node.destroy();
|
|
},
|
|
|
|
start () {
|
|
|
|
},
|
|
|
|
// update (dt) {},
|
|
});
|