33 lines
528 B
JavaScript
33 lines
528 B
JavaScript
var Utils = require('Utils');
|
|
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
lb_name: {
|
|
default: null,
|
|
type: cc.Label,
|
|
},
|
|
sp_icon: {
|
|
default: null,
|
|
type: cc.Sprite,
|
|
},
|
|
sp_frame: {
|
|
default: null,
|
|
type: cc.Sprite,
|
|
},
|
|
},
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
// onLoad () {},
|
|
|
|
start() {},
|
|
initdata(obj) {
|
|
this.lb_name.string = obj.name;
|
|
Utils.setitem(this, obj.headid, this.sp_icon);
|
|
Utils.setitem(this, obj.head_frame, this.sp_frame);
|
|
},
|
|
|
|
// update (dt) {},
|
|
});
|