Skip to content

Commit 456f162

Browse files
committed
animation fixes for tweening blends sync problem.
1 parent b998b2f commit 456f162

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ - (void)runActionsForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)s
387387
CCActionSequence* seq = [CCActionSequence actionWithArray:actions];
388388
seq.tag = _animationManagerId;
389389
[seq startWithTarget:node];
390-
if(startFrame == 0 && _loop) { // Ensure Sync
390+
if(kf0.time > 0 || _loop) { // Ensure Sync
391391
[seq step:0];
392-
[seq step:_runningSequence.time-kf0.time];
392+
[seq step:_runningSequence.time-kf0.time - _runningSequence.tween];
393393
}
394394
[_currentActions addObject:seq];
395395
}
@@ -464,6 +464,7 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
464464
// Set the running scene
465465
_runningSequence = [self sequenceFromSequenceId:seqId];
466466
_runningSequence.time = 0.0f;
467+
_runningSequence.tween = tweenDuration;
467468

468469
[self addSequenceCallBacks:seqId tweenDuration:tweenDuration startTime:0];
469470

cocos2d-ui/CCBReader/CCBSequence.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
@property (nonatomic,assign) int sequenceId;
3636
@property (nonatomic,assign) int chainedSequenceId;
3737
@property (nonatomic,assign) int loops; // @todo
38+
@property (nonatomic,assign) float tween;
3839

3940
// Channels
4041
@property (nonatomic,strong) CCBSequenceProperty* callbackChannel;

cocos2d-ui/CCBReader/CCBsequence.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ - (id)init
4242

4343
_callbackChannel = nil;
4444
_soundChannel = nil;
45+
_tween = 0.0f;
4546

4647
return self;
4748
}

0 commit comments

Comments
 (0)