@@ -387,9 +387,9 @@ - (void)runActionsForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)s
387
387
CCActionSequence* seq = [CCActionSequence actionWithArray: actions];
388
388
seq.tag = _animationManagerId;
389
389
[seq startWithTarget: node];
390
- if (kf0.time > 0 || _loop) { // Ensure Sync
390
+ if (kf0.time > 0 || _loop) { // Ensure Sync
391
391
[seq step: 0 ];
392
- [seq step: _runningSequence.time-kf0.time];
392
+ [seq step: _runningSequence.time-kf0.time - _runningSequence.tween ];
393
393
}
394
394
[_currentActions addObject: seq];
395
395
}
@@ -464,6 +464,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
464
464
// Set the running scene
465
465
_runningSequence = [self sequenceFromSequenceId: seqId];
466
466
_runningSequence.time = 0 .0f ;
467
+ _runningSequence.tween = tweenDuration;
467
468
468
469
[self addSequenceCallBacks: seqId tweenDuration: tweenDuration startTime: 0 ];
469
470
@@ -476,6 +477,19 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
476
477
NSDictionary * seqNodeProps = [seqs objectForKey: [NSNumber numberWithInt: seqId]];
477
478
478
479
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
+
479
493
480
494
if (_lastSequence.sequenceId !=seqId) {
481
495
_loop = NO ;
@@ -495,17 +509,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
495
509
}
496
510
}
497
511
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
+
509
513
510
514
}
511
515
0 commit comments