0

我在 Sprite Builder 中找到 CCBFile 并添加到主场景中,现在当我运行项目时 CCBFile 动画会自动启动。我想在延迟一段时间后开始或调用它......有什么想法吗?

这是我的代码...

@implementation MainScene {
CCPhysicsNode *_physicsNode;
CCNode *playerbackwardshort;

}

// is called when CCB file has completed loading
- (void)didLoadFromCCB {

//For Delay
[self performSelector:@selector(Upgrade)  withObject:nil afterDelay:0.6];
}


-(void)Upgrade{
CCBAnimationManager* am = self.userObject;
[am runAnimationsForSequenceNamed:@"playerbackwardshort"];
}
4

1 回答 1

1

CCBAnimationManager用于此。假设您将动画命名为“AnimationTest”。要阻止它自动运行,在时间线属性中有一个选项(请参见此处

// in the loaded ccb file's class
CCBAnimationManager* animationManager = self.userObject;
[animationManager runAnimationsForSequenceNamed:@"AnimationTest"];
于 2014-06-07T14:59:09.683 回答