操作不在此代码中运行:
SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight];
NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;
[self.scene.view presentScene: start transition: reveal];
如果我评论 NewYork switching 它们会起作用。
最佳答案
action *moveLeft/*moveRight 的问题,因为立即开始转换到 NewYork 场景,所以你应该等待 *moveLeft/*moveRight 完成,如下所示:
SKAction *moveLeft = [SKAction moveToX:(-800) duration:0.6];
SKAction *moveRight = [SKAction moveToX:(800) duration:0.6];
[_labelLogo runAction:moveLeft];
[_labelPlay runAction:moveRight completion:^{
NewYork *start = [[NewYork alloc] initWithSize:self.size];
SKTransition *reveal = [SKTransition fadeWithColor:[UIColor clearColor] duration:2];
reveal.pausesIncomingScene = NO;
[self.view presentScene:start transition:reveal];
}];
关于ios - 在切换到新场景之前,Sprite 套件无法运行 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22664741/