这是我的代码:
rotateClockWise = [SKAction rotateByAngle:-M_PI duration:skRand(0, 2.5)];
rotateClockWise = [SKAction repeatActionForever:rotateClockWise];
[asteroid1 runAction:rotateClockWise];
有没有办法停止 rotateClockWise 动作?
这是我的代码:
rotateClockWise = [SKAction rotateByAngle:-M_PI duration:skRand(0, 2.5)];
rotateClockWise = [SKAction repeatActionForever:rotateClockWise];
[asteroid1 runAction:rotateClockWise];
有没有办法停止 rotateClockWise 动作?
在斯威夫特
asteroid1.runAction(action, withKey: "actionKey")
asteroid1.removeActionForKey("actionKey")
你应该给一个动作的关键:
[asteroid1 runAction:rotateClockWise withKey:@"rotateClock"];
在您可以通过这种方式停止此操作之后:
[asteroid1 removeActionForKey:@"rotateClock"];