@@ -387,9 +387,9 @@ - (void)runActionsForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)s
387387 CCActionSequence* seq = [CCActionSequence actionWithArray: actions];
388388 seq.tag = _animationManagerId;
389389 [seq startWithTarget: node];
390- if (kf0.time > 0 || _loop) { // Ensure Sync
390+ if (kf0.time > 0 || _loop) { // Ensure Sync
391391 [seq step: 0 ];
392- [seq step: _runningSequence.time-kf0.time];
392+ [seq step: _runningSequence.time-kf0.time - _runningSequence.tween ];
393393 }
394394 [_currentActions addObject: seq];
395395}
@@ -464,6 +464,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
464464 // Set the running scene
465465 _runningSequence = [self sequenceFromSequenceId: seqId];
466466 _runningSequence.time = 0 .0f ;
467+ _runningSequence.tween = tweenDuration;
467468
468469 [self addSequenceCallBacks: seqId tweenDuration: tweenDuration startTime: 0 ];
469470
@@ -476,6 +477,19 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
476477 NSDictionary * seqNodeProps = [seqs objectForKey: [NSNumber numberWithInt: seqId]];
477478
478479 NSMutableSet * seqNodePropNames = [NSMutableSet set ];
480+
481+ // Reset nodes that have sequence node properties, build first keyframe action sequence.
482+ for (NSString * propName in seqNodeProps) {
483+ CCBSequenceProperty* seqProp = [seqNodeProps objectForKey: propName];
484+ [seqNodePropNames addObject: propName];
485+
486+ // Reset Node State to First KeyFrame
487+ [self setKeyFrameForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration keyFrame: 0 ];
488+
489+ // Build First Key Frame Sequence
490+ [self runActionsForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration startKeyFrame: 0 ];
491+ }
492+
479493
480494 if (_lastSequence.sequenceId !=seqId) {
481495 _loop = NO ;
@@ -495,17 +509,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
495509 }
496510 }
497511
498- // Reset nodes that have sequence node properties, build first keyframe action sequence.
499- for (NSString * propName in seqNodeProps) {
500- CCBSequenceProperty* seqProp = [seqNodeProps objectForKey: propName];
501- [seqNodePropNames addObject: propName];
502-
503- // Reset Node State to First KeyFrame
504- [self setKeyFrameForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration keyFrame: 0 ];
505-
506- // Build First Key Frame Sequence
507- [self runActionsForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration startKeyFrame: 0 ];
508- }
512+
509513
510514 }
511515
0 commit comments