Merge pull request #2581 from CocosAss/v1.9

fixed the sequence can't excute the action correctly problem
This commit is contained in:
pandamicro
2018-04-24 18:57:44 +08:00
committed by GitHub
+6 -2
View File
@@ -340,10 +340,13 @@ cc.Sequence = cc.ActionInterval.extend({
* @return {Boolean}
*/
initWithTwoActions:function (actionOne, actionTwo) {
if(!actionOne || !actionTwo)
if (!actionOne || !actionTwo)
throw new Error("cc.Sequence.initWithTwoActions(): arguments must all be non nil");
var d = actionOne._duration + actionTwo._duration;
var durationOne = actionOne._duration, durationTwo = actionTwo._duration;
durationOne *= actionOne._repeatMethod ? actionOne._timesForRepeat : 1;
durationTwo *= actionTwo._repeatMethod ? actionTwo._timesForRepeat : 1;
var d = durationOne + durationTwo;
this.initWithDuration(d);
this._actions[0] = actionOne;
@@ -361,6 +364,7 @@ cc.Sequence = cc.ActionInterval.extend({
startWithTarget:function (target) {
cc.ActionInterval.prototype.startWithTarget.call(this, target);
this._split = this._actions[0]._duration / this._duration;
this._split *= this._actions[0]._repeatMethod ? this._actions[0]._timesForRepeat : 1;
this._last = -1;
},