Skip to content

Commit 7d242d3

Browse files
committed
Merge branch 'v3.1' of github.com:cocos2d/cocos2d-iphone into v3.1
2 parents f8786c0 + 506d365 commit 7d242d3

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ - (id)init {
5252
_nodeSequences = [[NSMutableDictionary alloc] init];
5353
_baseValues = [[NSMutableDictionary alloc] init];
5454

55-
// Scheduler
56-
_scheduler = [[CCDirector sharedDirector] scheduler];
57-
[_scheduler scheduleTarget:self];
58-
[_scheduler setPaused:NO target:self];
59-
6055
// Current Sequence Actions
6156
_currentActions = [[NSMutableArray alloc] init];
6257
_playbackSpeed = 1.0f;
@@ -81,6 +76,13 @@ - (CGSize)containerSize:(CCNode*)node {
8176
}
8277
}
8378

79+
-(void) onEnter {
80+
// Setup Scheduler
81+
_scheduler = [[CCDirector sharedDirector] scheduler];
82+
[_scheduler scheduleTarget:self];
83+
[_scheduler setPaused:NO target:self];
84+
}
85+
8486
- (void)addNode:(CCNode*)node andSequences:(NSDictionary*)seq
8587
{
8688
#ifdef DEBUG
@@ -199,7 +201,7 @@ - (CCActionInterval*)actionFromKeyframe0:(CCBKeyframe*)kf0 andKeyframe1:(CCBKeyf
199201
} else if ([name isEqualToString:@"rotationalSkewY"]) {
200202
return [CCActionRotateTo actionWithDuration:duration angleY:[kf1.value floatValue]];
201203
} else if ([name isEqualToString:@"opacity"]) {
202-
return [CCActionFadeTo actionWithDuration:duration opacity:[kf1.value intValue]];
204+
return [CCActionFadeTo actionWithDuration:duration opacity:[kf1.value floatValue]];
203205
} else if ([name isEqualToString:@"color"]) {
204206
CCColor* color = kf1.value;
205207
return [CCActionTintTo actionWithDuration:duration color:color];

cocos2d-ui/CCBReader/CCBReader.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ - (CCNode*) readNodeGraphParent:(CCNode*)parent
13391339
embeddedNode.scaleX = ccbFileNode.scaleX;
13401340
embeddedNode.scaleY = ccbFileNode.scaleY;
13411341
embeddedNode.name = ccbFileNode.name;
1342-
embeddedNode.visible = YES;
1342+
embeddedNode.visible = ccbFileNode.visible;
13431343
//embeddedNode.ignoreAnchorPointForPosition = ccbFileNode.ignoreAnchorPointForPosition;
13441344

13451345
[animationManager moveAnimationsFromNode:ccbFileNode toNode:embeddedNode];

cocos2d/CCActionInstant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@
184184
* This action allows a custom function to be called.
185185
*/
186186
@interface CCActionCallFunc : CCActionInstant <NSCopying> {
187-
id _targetCallback;
187+
__weak id _targetCallback;
188188
SEL _selector;
189189
}
190190

191191
/** Target function that will be called. */
192-
@property (nonatomic, readwrite, strong) id targetCallback;
192+
@property (nonatomic, readwrite, weak) id targetCallback;
193193

194194

195195
/// -----------------------------------------------------------------------

cocos2d/CCNode.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,10 @@ -(void) onEnter
11081108
[[CCDirector sharedDirector].actionManager migrateActions:self from:[CCDirector sharedDirector].actionManagerFixed];
11091109
[self setActionManager:[CCDirector sharedDirector].actionManager];
11101110
}
1111+
1112+
if(_animationManager) {
1113+
[_animationManager performSelector:@selector(onEnter)];
1114+
}
11111115

11121116
[self wasRunning:wasRunning];
11131117
}

0 commit comments

Comments
 (0)