Coco2d v3如何从像糖果粉碎游戏的父节点中删除精灵?

时间:2015-08-13 13:17:47

标签: ios cocos2d-iphone

当我选择精灵类型时,我想从节点中删除精灵,它只进行缩放而不是从节点中删除。请帮我。 提前谢谢。

for (ImageView *cookie in chain.cookies) {

        // 1
        if (cookie.sprites != nil) {

            // 2
            CCActionScaleTo *Scaleaction =[CCActionScaleTo actionWithDuration:0.3 scale:0.1];
            CCActionCallBlock *action2=[CCActionCallBlock actionWithBlock:^{

                [self removeFromParentAndCleanup:YES];
            }];


           // CCAction *scaleAction = [SKAction scaleTo:0.1 duration:0.3];
            //scaleAction.timingMode = SKActionTimingEaseOut;
            [cookie.sprites runAction:[CCActionSequence actionWithArray:@[Scaleaction,action2]]];
            // 3
            cookie.sprites = nil;
        }
    }
}

0 个答案:

没有答案