我要在删除SKAction
节点之前添加一些SKScene
动画。当我尝试这样做时,SKAction在最初的2-4个精灵中从10-40开始执行。如果我发表评论[node runAction:action];
并且只是放[node removeFromParent];
,那么一切正常。有人可以帮助我,我在这里做错了什么:
[self enumerateChildNodesWithName:@"dblock" usingBlock:^(SKNode *node, BOOL *stop) {
TRBlock *droppedBlock = (TRBlock *)node;
if ([linesToRemove containsIndex:droppedBlock.localCoordinates.y]) {
//[node runAction:animationAction completion:^{
[node removeFromParent];
//}];
} else {
if ([linesToRemove indexLessThanIndex:droppedBlock.localCoordinates.y] != NSNotFound) {
droppedBlock.localCoordinates = TRBoardCoordinatesMake(droppedBlock.localCoordinates.x,
droppedBlock.localCoordinates.y - completeLines.count);
CGPoint targetPoint = calculatedPositionFromBlockBoardCoordinates(droppedBlock.localCoordinates);
droppedBlock.position = targetPoint;
}
// [droppedBlock runAction:[SKAction moveToY:targetPoint.y duration:0.2]];
}
}];
你可以看到所有SKAction
在这里发表评论并且一切正常,但我怎么能用动画做到这一点?
我已经尝试了很多不同的SKAction
甚至sequence
和group
,runWithCompletion:
- 相同的结果,适用于少数首先SKNode
,但尝试跑几十个。