操作不会在此代码中运行:
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切换他们的工作。
答案 0 :(得分:3)
问题到行动* 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];
}];