You can preload SKTexturewhat you use in LevelerScenebefore presenting the scene. Then, as soon as the download is finished, you will present the scene. Here is an example from Apple Documentation translated into Swift:
SKTexture.preloadTextures(arrayOfYourTextures) {
if let scene = GameScene(fileNamed: "GameScene") {
let skView = self.view as! SKView
skView.presentScene(scene)
}
}
In your case, you have several options:
1.
, LevelerScene, GameScene:
class LevelerScene : SKScene {
let textures = [SKTexture(imageNamed: "Tex1"), SKTexture(imageNamed: "Tex1")]
}
GameScene, :
if let view = self.view {
let leveler = LevelerScene(fileNamed: "LevelerScene")
SKTexture.preloadTextures(leveler.textures) {
view.presentScene(leveler)
}
}
, , GameScene, LevelerScene.
SKScene LevelerScene. GameScene , , LevelerScene .
, , LevelerScene, LevelerScene deinit -ed, . , LevelerScene, .
2. SKTexture.preloadTextures GameViewController , SKScene. (, ), LevelerScene ( - , ).
, SKTexture , . , , , . , , , .
. .
, !