これは機能します:
for (Object *oneObj in allObjects) {
id moveAction = [CCMoveTo actionWithDuration:0.3f position:ccp(tx, ty)];
id rotateAction = [CCRotateTo actionWithDuration:0.3 angle:0.0f];
id action = [CCSpawn actions:moveAction, rotateAction, nil];
id sequence = [CCSequence actions: action,
[CCDelayTime actionWithDuration:0.1f],
nil];
[oneObj runAction:sequence];
}
これは機能しません(1つのオブジェクトだけがこのオブジェクトによって移動されます):
id moveAction = [CCMoveTo actionWithDuration:0.3f position:ccp(tx, ty)];
id rotateAction = [CCRotateTo actionWithDuration:0.3 angle:0.0f];
id action = [CCSpawn actions:moveAction, rotateAction, nil];
id sequence = [CCSequence actions: action,
[CCDelayTime actionWithDuration:0.1f],
nil];
for (Object *oneObj in allObjects) {
[oneObj runAction:sequence];
}
なぜ?