@@ -171,10 +171,6 @@ - (CCBSequence*)sequenceFromSequenceId:(int)seqId {
171
171
- (CCActionInterval*)actionFromKeyframe0 : (CCBKeyframe*)kf0 andKeyframe1 : (CCBKeyframe*)kf1 propertyName : (NSString *)name node : (CCNode*)node {
172
172
float duration = kf1.time - kf0.time ;
173
173
174
- if (kf0.easingType ==kCCBKeyframeEasingInstant ) {
175
- duration = 0 ;
176
- }
177
-
178
174
if ([name isEqualToString: @" rotation" ]) {
179
175
return [CCActionRotateTo actionWithDuration: duration angle: [kf1.value floatValue ] simple: YES ];
180
176
} else if ([name isEqualToString: @" position" ]) {
@@ -360,7 +356,7 @@ - (void)runActionsForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)s
360
356
if (numKeyframes<1 ) return ;
361
357
362
358
// Action Sequence Builder
363
- NSMutableArray * actions = [NSMutableArray array ];
359
+ NSMutableArray * actions = [NSMutableArray array ];
364
360
int endFrame = startFrame+1 ;
365
361
366
362
if (endFrame==numKeyframes || endFrame<0 )
@@ -469,6 +465,11 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
469
465
_paused = YES ;
470
466
[self clearAllActions ];
471
467
468
+ // Set the running scene
469
+ _runningSequence = [self sequenceFromSequenceId: seqId];
470
+ _runningSequence.time = 0 .0f ;
471
+ _runningSequence.tween = tweenDuration;
472
+
472
473
[self addSequenceCallBacks: seqId tweenDuration: tweenDuration startTime: 0 ];
473
474
474
475
// Contains all Sequence Propertys / Keyframe
@@ -510,26 +511,13 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
510
511
}
511
512
}
512
513
}
513
-
514
- // Reset nodes that have sequence node properties, build first keyframe action sequence.
515
- for (NSString * propName in seqNodeProps) {
516
- CCBSequenceProperty* seqProp = [seqNodeProps objectForKey: propName];
517
- [seqNodePropNames addObject: propName];
518
-
519
- // Reset Node State to First KeyFrame
520
- [self setKeyFrameForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration keyFrame: 0 ];
521
-
522
- }
514
+
523
515
}
524
516
525
517
526
518
}
527
519
528
- // Set the running scene
529
- _runningSequence = [self sequenceFromSequenceId: seqId];
530
- _runningSequence.time = 0 .0f ;
531
-
532
- _paused = NO ;
520
+ _paused = NO ;
533
521
}
534
522
535
523
- (void )runAnimationsForSequenceNamed : (NSString *)name tweenDuration : (float )tweenDuration {
@@ -864,8 +852,8 @@ - (CCActionSequence*)createActionForNode:(CCNode*)node sequenceProperty:(CCBSequ
864
852
// Instant
865
853
if (startKF.easingType ==kCCBKeyframeEasingInstant ) {
866
854
[actions addObject: [CCActionDelay actionWithDuration: endKF.time-startKF.time]];
867
- }
868
-
855
+ }
856
+
869
857
// Apply Easing
870
858
action = [self easeAction: action easingType: startKF.easingType easingOpt: startKF.easingOpt];
871
859
[actions addObject: action];
0 commit comments