cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //    default: null,      // The default value will be used only when the component attaching
        //                           to a node for the first time
        //    url: cc.Texture2D,  // optional, default is typeof default
        //    serializable: true, // optional, default is true
        //    visible: true,      // optional, default is true
        //    displayName: 'Foo', // optional
        //    readonly: false,    // optional, default is false
        // },
        // ...
        _actorId:"",
    },

    // use this for initialization
    onLoad: function () {
        this.loadActor();
    },
    initAcot:function(actorId){
        this._actorId =  "actor_"+actorId;
    },
    loadActor:function(){
        cc.loader.loadResDir(this._actorId, (error, assets)=> {
            if (error) {
                cc.log(error)
                return;
            }
            let skeleton = this.node.getComponent(sp.Skeleton);
            for (var i = 0; i < assets.length; i++) {
                if (assets[i] instanceof sp.SkeletonData) { skeleton.skeletonData = assets[i] }
            }
            skeleton.setAnimation(0,"standby", true)
        })
    }
    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
