这有效:
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];
}
这不起作用(这个对象只移动了一个对象):
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];
}
为什么?