我在我的游戏场景之间创建了多个过渡,所以我不确定为什么这段代码不起作用。
在我的 GameViewController 中,我只是将我的 TitleScene 设置为下一个场景,但我希望它淡入。我在 touchesBegan 中成功地做到了这一点。
这是代码:
@implementation GameViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Configure the view.
SKView * skView = (SKView *)self.view;
skView.showsFPS = NO;
skView.showsNodeCount = NO;
/* Sprite Kit applies additional optimizations to improve rendering performance */
skView.ignoresSiblingOrder = YES;
// Create and configure the scene.
SKScene * scene = [TitleScene sceneWithSize:skView.frame.size];
scene.scaleMode = SKSceneScaleModeResizeFill;
// Present the scene.
SKTransition *transition = [SKTransition fadeWithColor:[SKColor blackColor] duration:3.6];
[skView presentScene:scene transition:transition];
}