在 fileNamed 的文档中:从 .sks 文件加载场景时说:
The name of the file, without a file extension.
The file must be in the app’s main bundle and have a .sks filename extension.
我在 Playground 中的用法:
if let scene = PlanetsScene(fileNamed: "PlanetsScene")
有什么解决方法吗?在 Playground 中运行的东西似乎无法访问应用程序主包。我已将我的 Playground 嵌入到项目工作区中,并且可以访问我设置为公共(public)的所有其他类,但似乎不能只加载 .sks
文件。
最佳答案
你能把指向原始 *.sks
文件的符号链接(symbolic link)放到你的 Playground 的 Resources
中吗?
关于ios - 如何从嵌入工作区的 Swift Playground 加载 .sks 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48331355/