[SKScene enumerateObjectsUsingBlock:]时SKAction无法正常工作

时间:2013-12-06 00:16:13

标签: objective-c ios7 sprite-kit skaction skscene

我要在删除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甚至sequencegrouprunWithCompletion: - 相同的结果,适用于少数首先SKNode,但尝试跑几十个。

0 个答案:

没有答案