獲取動畫屬性 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));