showResultPanel: function () {
var self = this;
var resultNode = self.panel_Win;
if (this._gameResult.isWin) {
cc.gg.audioMgr.playSFX("niuniu/putong/win");
resultNode = self.panel_Win;
} else {
cc.gg.audioMgr.playSFX("niuniu/putong/lost");
resultNode = self.Panel_Lose;
}
var anim = resultNode.getComponent(cc.Animation);
anim.once('finished', this.resultAnimationPlayFinished, this);
var animState = anim.play(null, 0);
animState.wrapMode = cc.WrapMode.Normal;
this._resultNode.active = true;
this._resultNode.opacity = 255;
},
/*
* 播放结果面板动画
*/
showResultAnimationPlayFinished: function (eventType, animationState) {
this.scheduleOnce(this.hideResultAnimationPlayFinished, 0.5);
this.playLostPlayerFlyGold();
},
/*
* 反向播放结果面板,用于隐藏面板
*/
hideResultAnimationPlayFinished: function (eventType, animationState) {
// var anim = this._resultNode.getComponent(cc.Animation);
// anim.once('finished', this.hideResultPanel, this);
// var animState = anim.play();
// animState.wrapMode = cc.WrapMode.Reverse;
this._resultNode.runAction(cc.sequence(cc.fadeOut(0.5), cc.callFunc(function (target) {
var anim = target.getComponent(cc.Animation);
anim.play(null, 0);
anim.sample();
anim.stop();
}, this)));
},