const ArtistManager = require('../utils/ArtistManager');
cc.Class({
    extends: cc.Component,

    properties: {
        role: sp.Skeleton,
    },


    onLoad() { },

    bind(jobInfo, gender) {
        // skinSkeleton.skeletonData = 
        // this.nameLabel.string = '<outline color=#ffffff width=2><b>' + jobInfo.name + '</b></outline>';
        // this.summaryLabel.string = jobInfo.msg;
        // let picId = 50000 + jobInfo.id;
        // this.titleText.string = `<img src='${picId}' /> <outline color=#584A47 width=3><b>${jobInfo.name}</b></outline>`

        // cc.loader.loadRes(jobInfo.picId, cc.SpriteFrame, (error, spriteFrame) => {
        //     this.iconSripte.spriteFrame = spriteFrame;
        // });

        //现在只有舞者有骨骼动画，默认jodId为2
        ArtistManager.loadArtist(true, gender, 2)
            .then((skeletonData) => {
                this.role.skeletonData = skeletonData;
                this.role.animation = "stand";
            }).catch((err) => {
                console.log(err);
            });
    },

    start() {

    },

    // update (dt) {},
});
