我正在使用 CCSequence 动作,我希望我的精灵在触摸并按住时保持特定动作,并在触摸结束后继续序列。
-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
id downward = [CCRotateTo actionWithDuration:0.1 angle:45];
id straight = [CCRotateTo actionWithDuration:0.1 angle:0];
id stable = [CCSequence actionWithDuration:1.0];
id upward = [CCRotateTo actionWithDuration:0.1 angle:-45];
id Seq = [CCSequence actions:downward, straight, stable, upward, nil];
[mySprite runAction:Seq];
}
-(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event{
}
我想要这个“id stable = [CCSequence actionWithDuration:1.0];” 在 Touch 处于保持状态时替换为时间间隔的浮点数。并在触摸结束时重置它。
任何帮助深表感谢。