Files
fc/dev/project/assets/Scripts/mod/pve/adventure/cmp/cmp.adventure.item.hero.js
T
2026-05-23 22:10:14 +08:00

49 lines
999 B
JavaScript

const ItemBase = require("nx.fx.sv.expand.item");
cc.Class({
extends: ItemBase,
properties: {
show:{
default:null,
type:cc.Node
},
camp:{
default:null,
type:cc.Node
},
focus:{
default:null,
type:cc.Node
}
},
rebind(_idx,_data,_key){
this._super(_idx, _data, _key);
this.setData(_data);
},
start () {
},
setData(data){
if(nx.dt.objEmpty(data))return;
let res_path = cc.js.formatStr("resDB/models/%s/half_show2",data.bustid);
nx.gui.setSpriteFrame(this.show,"",res_path);
nx.gui.setSpriteFrame(this.camp,"",cc.js.formatStr("coms/images/camps%s",data.camp_type));
},
onFocus(){
this.focus.active = true;
this.node.runAction(cc.moveBy(0.1,cc.v2(0,25)));
},
outFocus(){
this.focus.active = false;
this.node.y = 0;
}
// update (dt) {},
});