28 lines
527 B
JavaScript
28 lines
527 B
JavaScript
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
box: {
|
|
default: null,
|
|
type: cc.Sprite
|
|
},
|
|
type: 'wood',
|
|
status: 'c'
|
|
},
|
|
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
onLoad () {
|
|
let url = `textures/part1/bar_cube_${this.type}_${this.status}`;
|
|
let self = this;
|
|
cc.loader.loadRes(url, cc.SpriteFrame, function (err, spriteFrame) {
|
|
self.box.spriteFrame = spriteFrame;
|
|
});
|
|
},
|
|
|
|
start () {
|
|
},
|
|
|
|
// update (dt) {},
|
|
});
|