将 SpriteKit 场景添加到 Xcode 上的 Swift Playground App 项目?
我想在Xcode上的Swift Playground App Project(.swiftpm)中添加一个SKSCENE(.SK),但是当我将其添加到项目导航器中时,我会收到以下错误:
找到1个未经用手的文件;明确将它们声明为资源,或将其排除在目标之外,
如何使其在不添加其他Swift软件包中的情况下使其正常工作?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,我到处搜索但没有找到解决方案。
我在 Playgrounds 上创建了新的应用程序,并通过右键单击 Playgrounds 项目文件夹,使用“显示包内容”查看应用程序根文件夹中的“Package.swift”文件。
经过比较,我发现目标中缺少“资源”标签。我添加了资源标签并分配了“资源”文件夹名称,这解决了问题。
检查“Package.swift”文件中的目标是否缺少以下代码。
I had the same problem and I searched everywhere but did not find the solution.
I created new App on Playgrounds and looked into the "Package.swift" file in the root folder of the App using "Show Package Contents" by right clicking on Playgrounds project folder.
On comparing I found that "resources" tag was missing from targets. I added resources tag and assigned the "Resources" folder name and that fixed the issue.
Check if following code is missing from targets in "Package.swift" file.