1
我有两个场景:家庭和游戏。与过渡到主场景相比,过渡到场景真的很慢。我认为这是因为我的比赛场面更多。有什么方法可以预先加载场景吗?或者让过渡更加无缝?缓慢Skscene转换
我对这个论坛的答案感兴趣Preload a Scene to prevent lag? 但我不知道从哪里开始。我在哪里放置部分和B部分的答案
这里是我使用
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
let touch = touches
let location = touch.first!.locationInNode(self)
let node = self.nodeAtPoint(location)
if (node.name == "Balloon") {
let sceneAction = SKAction.runBlock({
let secondScene = Scene2(size: self.size)
let transition = SKTransition.fadeWithDuration(1)
secondScene.scaleMode = SKSceneScaleMode.AspectFill
self.scene!.view?.presentScene(secondScene, transition: transition)
})
PlayButton.runAction(SKAction.sequence([sound,SKAction.animateWithTextures(array, timePerFrame: 0.1),sceneAction,SKAction.waitForDuration(1)]))
}
什么任何其他解决办法是罚款。
感谢
嘿感谢的响应。我为swift 3试了这个,它不起作用。你能否更新你的答案? – Yraw
@Yraw检查更新 –
它给我一个错误“Gameconfiguration没有成员级别”。 – Yraw