ios - 文件打不开,版本太旧

标签 ios xcode scenekit

我想将粒子系统加载到我的 ARKit 应用程序中,但当我尝试执行此操作时出现此错误:

[SceneKit] Error: This file cannot be opened (version is too old)

我正在使用此代码加载粒子(在 SCNNode 子类中):

init() {
    guard let url = Bundle.main.url(forResource: "Models.scnassets/particles/particles", withExtension: "scnp")
        else { fatalError("can't find expected virtual object bundle resources") }
    guard let node = SCNReferenceNode(url: url)
        else { fatalError("can't find expected virtual object bundle resources") }
    super.init()
    self.addChildNode(node)
}

我有来自 ARKit 演示应用程序(来自 Apple)的代码。 articles.scnp 是从 Xcode 模板 Bokeh 生成的。我有 Xcode 9 beta 4,我的设备运行 iOS 11 beta 4。

最佳答案

SCNReferenceNode 只能引用场景文件。场景文件扩展名的示例有 daescn

.scnp 文件是 SCNParticleSystem 的存档,因此无法使用。

关于ios - 文件打不开,版本太旧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45488462/

相关文章:

ios - 崩溃报告 iOS

ios - ld : warning: directory not found for option -- deleting derived data and cleaning project don't work

objective-c - 无效的消费者自由职业者 API

ios - SceneKit - 纹理显示不正确

ios - 如何在iOS中跳转到拨号盘

ios - 模棱两可的 "use of unresolved identifier"错误?

ios - 中止陷阱 : 6 error in the new Swift 3. 1/Xcode 8.3

swift - SCNCamera 限制弧球旋转

ios - 替代动画(forKey :) (now deprecated)?

ios - 如何以编程方式访问 Assets 目录颜色集