In SpriteKit presentScene Transition, won't work. However, presentScene does

白昼怎懂夜的黑 提交于 2019-12-12 16:44:07

问题


let reveal = SKTransition.doorwayWithDuration(0.5)
            reveal.pausesIncomingScene = false
            reveal.pausesOutgoingScene = true
              //self.skView!.presentScene(self.gameOverMenu!, transition: reveal)
            self.skView!.presentScene(self.gameOverMenu)

That is the portion of code I'm using to present the new scene. The skView already has a scene running, I'm doing this from the view controller. When I do present scene it all works fine. But when I try to add the transition the new scene never shows up. The transition property of the view updates and so does the incoming and outgoing scene property. Any ideas?

Edit: It seems to be an issue with segueing from another VC to the current VC. If I remove my original landing VC and start the app at the VC that has the spritekit view, everything works normally. Now to either redesign how I am doing things, or figure out why moving to a new VC makes transitions stop working.

来源:https://stackoverflow.com/questions/35713804/in-spritekit-presentscene-transition-wont-work-however-presentscene-does

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!