如何告诉SKTextureAtlas停止动画并删除对象?

时间:2014-06-28 07:55:46

标签: ios objective-c sprite-kit

如何判断步行周期是否继续动画,直到带有bool标志的NSNumber停止它? 还可以从舞台中删除带有SKTexture的SKSpriteNode?

    SKSpriteNode *walk = [SKSpriteNode spriteNodeWithTexture:[_walkTextures objectAtIndex:0]];
    walk.zPosition = 100;
    walk.scale = spliffScale;
    walk.position = location;

    [self addChild:walk];

    SKAction *walkAction = [SKAction animateWithTextures:_walkTextures timePerFrame:0.03];

    SKAction *remove = [SKAction removeFromParent];
    [walk runAction:[SKAction sequence:@[walkAction, walkAction, remove]]];

0 个答案:

没有答案