OGeek|极客世界-中国程序员成长平台

标题: ios - 文件打不开,版本太旧 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 13:37
标题: ios - 文件打不开,版本太旧

我想将粒子系统加载到我的 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)的代码。 particles.scnp 是从 Xcode 模板 Bokeh 生成的。我有 Xcode 9 beta 4,我的设备运行 iOS 11 beta 4。



Best Answer-推荐答案


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

.scnp 文件是 SCNParticleSystem 的存档,因此不能使用。

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






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4