Skip to content

Commit b277ffc

Browse files
committed
fix animation tween unit test.
1 parent 9c58b15 commit b277ffc

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,11 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
465465
_paused = YES;
466466
[self clearAllActions];
467467

468+
// Set the running scene
469+
_runningSequence = [self sequenceFromSequenceId:seqId];
470+
_runningSequence.time = 0.0f;
471+
_runningSequence.tween = tweenDuration;
472+
468473
[self addSequenceCallBacks:seqId tweenDuration:tweenDuration startTime:0];
469474

470475
// Contains all Sequence Propertys / Keyframe
@@ -506,25 +511,12 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
506511
}
507512
}
508513
}
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-
}
514+
519515
}
520516

521517

522518
}
523519

524-
// Set the running scene
525-
_runningSequence = [self sequenceFromSequenceId:seqId];
526-
_runningSequence.time = 0.0f;
527-
528520
_paused = NO;
529521
}
530522

0 commit comments

Comments
 (0)