const ArtistManager = require('../utils/ArtistManager');
cc.Class({
extends: cc.Component,
properties: {
role: sp.Skeleton,
},
onLoad() { },
bind(jobInfo, gender) {
// skinSkeleton.skeletonData =
// this.nameLabel.string = '' + jobInfo.name + '';
// this.summaryLabel.string = jobInfo.msg;
// let picId = 50000 + jobInfo.id;
// this.titleText.string = ` ${jobInfo.name}`
// cc.loader.loadRes(jobInfo.picId, cc.SpriteFrame, (error, spriteFrame) => {
// this.iconSripte.spriteFrame = spriteFrame;
// });
//现在只有舞者有骨骼动画,默认jodId为2
ArtistManager.loadArtist(true, gender, jobInfo.id)
.then((skeletonData) => {
this.role.skeletonData = skeletonData;
this.role.animation = "stand";
}).catch((err) => {
console.log(err);
});
},
start() {
},
// update (dt) {},
});