mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #2581 from CocosAss/v1.9
fixed the sequence can't excute the action correctly problem
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user