来自 Oculus 集成包的 Unity Spatializer,用于在未触及 Unity 时抛出错误

Posted

技术标签:

【中文标题】来自 Oculus 集成包的 Unity Spatializer,用于在未触及 Unity 时抛出错误【英文标题】:Unity Spatializer from Oculus Integration package for Unity throwing errors when it hasn't been touched 【发布时间】:2021-07-20 07:51:55 【问题描述】:

构建在编辑器中运行良好,完全没有问题。但是当尝试为 android/PC、Mac 和 Linux Standalone/Universal Windows Platform unity 构建时,会向我抛出大约 30 个错误(下图),所有这些错误都属于 Unity Audio Spatializer 中的一系列脚本。我没有接触过这些脚本,我什至不知道它们是什么。有人解决了吗?

Image Of All Console Errors

Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioPluginUpdater.cs(24,19): error CS0234: The type or namespace name 'Callbacks' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(22,19): error CS0234: The type or namespace name 'Build' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(24,19): error CS0234: The type or namespace name 'SceneManagement' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationMaterialEditor.cs(29,55): error CS0246: The type or namespace name 'Editor' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioPluginUpdater.cs(32,2): error CS0246: The type or namespace name 'InitializeOnLoadAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioPluginUpdater.cs(32,2): error CS0246: The type or namespace name 'InitializeOnLoad' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationMaterialEditor.cs(28,2): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationMaterialEditor.cs(28,2): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationMaterialEditor.cs(515,24): error CS0115: 'ONSPPropagationMaterialEditor.OnInspectorGUI()': no suitable method found to override
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioPluginUpdater.cs(106,6): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioPluginUpdater.cs(106,6): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudiosourceEditor.cs(29,50): error CS0246: The type or namespace name 'Editor' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioSourceEditor.cs(27,2): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioSourceEditor.cs(27,2): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPAudioSourceEditor.cs(41,23): error CS0115: 'OculusSpatializerUserParamsEditor.OnInspectorGUI()': no suitable method found to override
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(42,35): error CS0246: The type or namespace name 'BuildTarget' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationGeometryEditor.cs(28,46): error CS0246: The type or namespace name 'Editor' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationGeometryEditor.cs(27,2): error CS0246: The type or namespace name 'CustomEditorAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationGeometryEditor.cs(27,2): error CS0246: The type or namespace name 'CustomEditor' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationGeometryEditor.cs(30,23): error CS0115: 'ONSPPropagationGeometryEditor.OnInspectorGUI()': no suitable method found to override
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(47,6): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(47,6): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPReflectionCustomGUI.cs(25,53): error CS0246: The type or namespace name 'IAudioEffectPluginGUI' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(53,6): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPPropagationSerializationManager.cs(53,6): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPReflectionCustomGUI.cs(42,32): error CS0246: The type or namespace name 'IAudioEffectPlugin' could not be found (are you missing a using directive or an assembly reference?)
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPReflectionCustomGUI.cs(27,28): error CS0115: 'OculusSpatializerReflectionCustomGUI.Name': no suitable method found to override
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPReflectionCustomGUI.cs(32,28): error CS0115: 'OculusSpatializerReflectionCustomGUI.Description': no suitable method found to override
Assets\Imported\Oculus\VR\Spatializer\editor\ONSPReflectionCustomGUI.cs(37,28): error CS0115: 'OculusSpatializerReflectionCustomGUI.Vendor': no suitable method found to override

我已尝试在项目设置 > 音频中将空间化器插件设置为 OculuSpatializer 我尝试了“为当前场景构建音频几何”和“为所有场景重建音频几何”

【问题讨论】:

请不要发布图片。问题应以文本形式包含问题本身中的所有相关信息,包括minimal reproducible example。 @ChrisMM 将所有错误添加为文本 【参考方案1】:

删除 Assets\Imported\Oculus\VR\Spatializer\editor 文件夹中的所有文件起作用

【讨论】:

以上是关于来自 Oculus 集成包的 Unity Spatializer,用于在未触及 Unity 时抛出错误的主要内容,如果未能解决你的问题,请参考以下文章

Unity开发VR——Oculus Rif_将Oculus接入Unity

Oculus Quest2 | Unity配置Oculus Quest2开发环境,并打包一个应用到真机测试

Oculus Quest2 | Unity配置Oculus Quest2开发环境,并打包一个应用到真机测试

unity 5.6.1 Oculus手柄输入问题

使用Unity开发Oculus Quest配置环境

使用Unity创建oculus quest 简易场景(实现头盔和操作杆的控制)