Cocos2d iphone cocos2D CCSequence随时间触摸并保持

Cocos2d iphone cocos2D CCSequence随时间触摸并保持,cocos2d-iphone,touch,nstimer,tapandhold,Cocos2d Iphone,Touch,Nstimer,Tapandhold,我正在使用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动作,我希望我的精灵在触摸和按住的同时保持特定动作,并在触摸结束后继续该序列

-(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];”替换为时间间隔浮动。并在触摸结束时将其重置


非常感谢您的帮助。

如果我记得很清楚,您应该能够为您的操作设置标记(setTag)


您可以在CCTouchStart中设置标记,并使用ccTouchEnded中的此标记从其节点检索此特定操作,这将允许您根据需要暂停、终止或替换操作。

如果我记得很清楚,您应该能够为您的操作设置标记(setTag)

您可以在CCTouchStart中设置标记,并使用ccTouchEnded中的此标记从其节点检索此特定操作,这将允许您根据需要暂停、终止或替换操作