@@ -254,6 +254,8 @@ - (void)setAnimatedProperty:(NSString*)name forNode:(CCNode*)node toValue:(id)va
254
254
} else if ([name isEqualToString: @" skew" ]) {
255
255
node.skewX = [[value objectAtIndex: 0 ] floatValue ];
256
256
node.skewY = [[value objectAtIndex: 1 ] floatValue ];
257
+ } else if ([name isEqualToString: @" visible" ]) {
258
+ [(CCSprite*)node setVisible: [value boolValue ]];
257
259
} else if ([name isEqualToString: @" spriteFrame" ]) {
258
260
[(CCSprite*)node setSpriteFrame: value];
259
261
} else {
@@ -463,11 +465,6 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
463
465
_paused = YES ;
464
466
[self clearAllActions ];
465
467
466
- // Set the running scene
467
- _runningSequence = [self sequenceFromSequenceId: seqId];
468
- _runningSequence.time = 0 .0f ;
469
- _runningSequence.tween = tweenDuration;
470
-
471
468
[self addSequenceCallBacks: seqId tweenDuration: tweenDuration startTime: 0 ];
472
469
473
470
// Contains all Sequence Propertys / Keyframe
@@ -493,7 +490,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
493
490
}
494
491
495
492
496
- if (_lastSequence.sequenceId !=seqId) {
493
+ if (_lastSequence.sequenceId !=seqId || _runningSequence. sequenceId !=seqId ) {
497
494
_loop = NO ;
498
495
499
496
// Reset the nodes that may have been changed by other timelines
@@ -504,17 +501,30 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
504
501
505
502
id value = [nodeBaseValues objectForKey: propName];
506
503
507
- if (value) {
504
+ if (value!= nil ) {
508
505
[self setAnimatedProperty: propName forNode: node toValue: value tweenDuration: tweenDuration];
509
506
}
510
507
}
511
508
}
509
+
510
+ // Reset nodes that have sequence node properties, build first keyframe action sequence.
511
+ for (NSString * propName in seqNodeProps) {
512
+ CCBSequenceProperty* seqProp = [seqNodeProps objectForKey: propName];
513
+ [seqNodePropNames addObject: propName];
514
+
515
+ // Reset Node State to First KeyFrame
516
+ [self setKeyFrameForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration keyFrame: 0 ];
517
+
518
+ }
512
519
}
513
520
514
-
515
521
516
522
}
517
523
524
+ // Set the running scene
525
+ _runningSequence = [self sequenceFromSequenceId: seqId];
526
+ _runningSequence.time = 0 .0f ;
527
+
518
528
_paused = NO ;
519
529
}
520
530
@@ -845,6 +855,13 @@ - (CCActionSequence*)createActionForNode:(CCNode*)node sequenceProperty:(CCBSequ
845
855
846
856
CCActionInterval* action = [self actionFromKeyframe0: startKF andKeyframe1: endKF propertyName: seqProp.name node: node];
847
857
858
+ // Create delay to fix instant easing on non instant actions
859
+ if (startKF.easingType ==kCCBKeyframeEasingInstant &&
860
+ ![seqProp.name isEqualToString: @" spriteFrame" ] &&
861
+ ![seqProp.name isEqualToString: @" visible" ]) {
862
+ [actions addObject: [CCActionDelay actionWithDuration: action.duration]];
863
+ }
864
+
848
865
if (action) {
849
866
// Apply Easing
850
867
action = [self easeAction: action easingType: startKF.easingType easingOpt: startKF.easingOpt];
0 commit comments