From 602cf64ca2d49963b3f2ea869fbfe0f750f5bbe6 Mon Sep 17 00:00:00 2001 From: 2youyouo2 <501251991@qq.com> Date: Mon, 10 Oct 2016 14:34:10 +0800 Subject: [PATCH] refine code --- cocos2d/animation/animation-curves.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cocos2d/animation/animation-curves.js b/cocos2d/animation/animation-curves.js index 331ca9309f..abc51e9011 100644 --- a/cocos2d/animation/animation-curves.js +++ b/cocos2d/animation/animation-curves.js @@ -297,7 +297,15 @@ var EventAnimCurve = cc.Class({ * @type {Object} * @default null */ - _lastWrappedInfo: null + _lastWrappedInfo: null, + + /** + * Ignore event index + * @property _ignoreIndex + * @type {number} + * @default NaN + */ + _ignoreIndex: NaN }, _wrapIterations: function (iterations) { @@ -319,7 +327,7 @@ var EventAnimCurve = cc.Class({ } if (this._ignoreIndex !== currentIndex) { - this._ignoreIndex = null; + this._ignoreIndex = NaN; } var lastWrappedInfo = this._lastWrappedInfo; @@ -402,7 +410,7 @@ var EventAnimCurve = cc.Class({ onTimeChangedManually: function (time, animationNode) { this._lastWrappedInfo = null; - this._ignoreIndex = null; + this._ignoreIndex = NaN; var info = animationNode.getWrappedInfo(time); var direction = info.direction;