简体   繁体   English

从ViewController加载SKScene

[英]Loading a SKScene from a ViewController

We're working on a small game where we needed to put a UITableView to summarize the highest scores, but when it comes to load back a SKScene from the said UITableView the app suddenly stops (no crashes or errors in the console, it just stops and freezes), is there a way to bypass this? 我们正在开发一款小型游戏,需要放置UITableView来汇总最高分,但是当涉及从上述UITableView加载SKScene时,应用程序突然停止(控制台没有崩溃或错误,它只是停止了并冻结),有没有办法绕过这个? The high score section is loaded from the Home scene, the same Home scene I'm trying to reach from the high score tableView. 高分部分是从Home场景加载的,与我尝试从高分tableView到达的Home场景相同。

Can you provide code? 你能提供代码吗? Make sure there is no breakpoint triggered that may stops your code while running. 确保没有触发任何断点,断点可能会在运行时停止您的代码。

And a recommendation From my experience - you should try to avoid combination between UIKit and SpriteKit, this will solve you allot of problems. 根据我的经验,提出一个建议-您应该避免在UIKit和SpriteKit之间组合使用,这将解决您遇到的问题。 There are many open source libraries (here is one ) that helps build UI components out of SKNodes. 有很多开放源代码库(这里是一个 ),可以帮助在SKNodes之外构建UI组件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM