Skip to content

Commit 4c776a9

Browse files
committed
fix animation tween unit test.
1 parent a543437 commit 4c776a9

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
@@ -469,6 +469,11 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
469469
_paused = YES;
470470
[self clearAllActions];
471471

472+
// Set the running scene
473+
_runningSequence = [self sequenceFromSequenceId:seqId];
474+
_runningSequence.time = 0.0f;
475+
_runningSequence.tween = tweenDuration;
476+
472477
[self addSequenceCallBacks:seqId tweenDuration:tweenDuration startTime:0];
473478

474479
// Contains all Sequence Propertys / Keyframe
@@ -510,25 +515,12 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
510515
}
511516
}
512517
}
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-
}
518+
523519
}
524520

525521

526522
}
527523

528-
// Set the running scene
529-
_runningSequence = [self sequenceFromSequenceId:seqId];
530-
_runningSequence.time = 0.0f;
531-
532524
_paused = NO;
533525
}
534526

0 commit comments

Comments
 (0)