0

我想问是否可以将 ccsequence 和 bool 结合起来?

[self runAction:[CCSequence actions:
                 myAnimation,
                 (myBool = YES),
                 [CCDelayTime actionWithDuration:myTime],
                 [CCCallFunc actionWithTarget:self selector:@selector(otherAnimation)],
                 nil]];

但如果我这样做,程序就会崩溃。

有人知道解决办法吗??

4

1 回答 1

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:
}
于 2013-05-24T09:40:58.310 回答