我想问一下是否可以将ccsequence和bool结合起来?
[self runAction:[CCSequence actions:
myAnimation,
(myBool = YES),
[CCDelayTime actionWithDuration:myTime],
[CCCallFunc actionWithTarget:self selector:@selector(otherAnimation)],
nil]];
但如果我这样做,程序就会崩溃。
有人知道解决方案吗?
答案 0 :(得分:2)
你是在正确的方式,你可以像这样改变你的行动
[self runAction:[CCSequence actions:
myAnimation,
//OLD_VERSION(myBool = YES),
[CCCallFunc actionWithTarget:self selector:@selector(yourBoolMethod)],
[CCDelayTime actionWithDuration:myTime],
[CCCallFunc actionWithTarget:self selector:@selector(otherAnimation)],
nil]];
和yourBoolMethod
内部将bool设置为true
-(void) yourBoolMethod {
myBool = YES:
}