creator sp.Skeleton,动画使用

拜拜、爱过 提交于 2019-12-09 18:38:55
获取动画属性
onLoad(){

    this.game_pk_ani = this.game_pk_ani_node.getComponent(sp.Skeleton);
    this.game_pk_ani_node.active = false;

},

 

调用播放

this.game_pk_ani_node.active = true;
//发起pk的人赢了vs2_Lwin,反之是vs2_Rwin
this.game_pk_ani.clearTracks();//清理所有播放队列的动画
var annimation_name = win_or_lose ? "vszuowin" : "vsyouwin";
//this.game_pk_ani.timeScale = 0.6;
this.game_pk_ani.setAnimation(0, annimation_name, false);
this.game_pk_ani.setCompleteListener(function () {
    this.game_pk_ani_node.active = false;
    left_ico.removeFromParent();
    right_ico.removeFromParent();
    //动画播放结束回调
    if (ccomplete_event) {
        ccomplete_event()
    }
}.bind(this));
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!