我想在特定时间启动 InFinite CCAction。我尝试使用 CCSequence,但它仅支持有限时间动画。
有什么想法吗?
最诚挚的问候, 帕拉斯
最佳答案
将您想要重复的操作放入方法中。然后将其放入您的 init 方法中
[[CCScheduler sharedScheduler] scheduleSelector:@selector(myMethod) forTarget:self interval:10 paused:NO];
这将在 10 秒后调用 myMethod,但是一旦进入 myMethod,您就会想要取消它的安排。所以我的方法应该是这样的。
- (void) myMethod
{
[[CCScheduler sharedScheduler] unscheduleSelector:@selector(myMethod) forTarget:self];
CCMoveBy *move = [CCMoveBy actionWithDuration:3 position:ccp(75,0)];
CCRepeatForever *repeat = [CCRepeatForever actionWithAction:move];
[mySprite runAction:repeat];
}
关于iphone - 在特定时间启动CCAction,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7801339/