@@ -254,6 +254,8 @@ - (void)setAnimatedProperty:(NSString*)name forNode:(CCNode*)node toValue:(id)va
254254 } else if ([name isEqualToString: @" skew" ]) {
255255 node.skewX = [[value objectAtIndex: 0 ] floatValue ];
256256 node.skewY = [[value objectAtIndex: 1 ] floatValue ];
257+ } else if ([name isEqualToString: @" visible" ]) {
258+ [(CCSprite*)node setVisible: [value boolValue ]];
257259 } else if ([name isEqualToString: @" spriteFrame" ]) {
258260 [(CCSprite*)node setSpriteFrame: value];
259261 } else {
@@ -463,11 +465,6 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
463465 _paused = YES ;
464466 [self clearAllActions ];
465467
466- // Set the running scene
467- _runningSequence = [self sequenceFromSequenceId: seqId];
468- _runningSequence.time = 0 .0f ;
469- _runningSequence.tween = tweenDuration;
470-
471468 [self addSequenceCallBacks: seqId tweenDuration: tweenDuration startTime: 0 ];
472469
473470 // Contains all Sequence Propertys / Keyframe
@@ -493,7 +490,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
493490 }
494491
495492
496- if (_lastSequence.sequenceId !=seqId) {
493+ if (_lastSequence.sequenceId !=seqId || _runningSequence. sequenceId !=seqId ) {
497494 _loop = NO ;
498495
499496 // Reset the nodes that may have been changed by other timelines
@@ -504,17 +501,32 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
504501
505502 id value = [nodeBaseValues objectForKey: propName];
506503
507- if (value) {
504+ if (value!= nil ) {
508505 [self setAnimatedProperty: propName forNode: node toValue: value tweenDuration: tweenDuration];
509506 }
510507 }
511508 }
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+ // Build First Key Frame Sequence
519+ [self runActionsForNode: node sequenceProperty: seqProp tweenDuration: tweenDuration startKeyFrame: 0 ];
520+ }
512521 }
513522
514-
515523
516524 }
517525
526+ // Set the running scene
527+ _runningSequence = [self sequenceFromSequenceId: seqId];
528+ _runningSequence.time = 0 .0f ;
529+
518530 _paused = NO ;
519531}
520532
@@ -845,6 +857,13 @@ - (CCActionSequence*)createActionForNode:(CCNode*)node sequenceProperty:(CCBSequ
845857
846858 CCActionInterval* action = [self actionFromKeyframe0: startKF andKeyframe1: endKF propertyName: seqProp.name node: node];
847859
860+ // Create delay to fix instant easing on non instant actions
861+ if (startKF.easingType ==kCCBKeyframeEasingInstant &&
862+ ![seqProp.name isEqualToString: @" spriteFrame" ] &&
863+ ![seqProp.name isEqualToString: @" visible" ]) {
864+ [actions addObject: [CCActionDelay actionWithDuration: action.duration]];
865+ }
866+
848867 if (action) {
849868 // Apply Easing
850869 action = [self easeAction: action easingType: startKF.easingType easingOpt: startKF.easingOpt];
0 commit comments