1

我正在使用 Microsoft MRTK v2.0.3,并且正在尝试将空间感知添加到我的项目中,但是当我选择空间感知配置文件时,我不断收到以下错误:

Unable to register IMixedRealitySpatialAwarenessObserver service with a null concrete type.
UnityEngine.Debug:LogError(Object)
Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:RegisterDataProviderInternal(Boolean, Type, SupportedPlatforms, Object[]) (at Assets/MixedRealityToolkit/Services/BaseDataProviderAccessCoreSystem.cs:178)
Microsoft.MixedReality.Toolkit.BaseDataProviderAccessCoreSystem:RegisterDataProvider(Type, SupportedPlatforms, Object[]) (at Assets/MixedRealityToolkit/Services/BaseDataProviderAccessCoreSystem.cs:151)
Microsoft.MixedReality.Toolkit.SpatialAwareness.MixedRealitySpatialAwarenessSystem:InitializeInternal() (at Assets/MixedRealityToolkit.Services/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystem.cs:96)
Microsoft.MixedReality.Toolkit.SpatialAwareness.MixedRealitySpatialAwarenessSystem:Initialize() (at Assets/MixedRealityToolkit.Services/SpatialAwarenessSystem/MixedRealitySpatialAwarenessSystem.cs:78)
Microsoft.MixedReality.Toolkit.<>c:<InitializeAllServices>b__60_0(IMixedRealityService) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:923)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServicesInOrder(Action`1) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:1019)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeAllServices() (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:923)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:InitializeServiceLocator() (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:468)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ResetConfiguration(MixedRealityToolkitConfigurationProfile) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:120)
Microsoft.MixedReality.Toolkit.Editor.<>c__DisplayClass30_0:<OnInspectorGUI>b__0() (at Assets/MixedRealityToolkit/Inspectors/Profiles/MixedRealityToolkitConfigurationProfileInspector.cs:428)
UnityEditor.EditorApplication:Internal_CallDelayFunctions() (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:209)

当我尝试在设备上进行模拟时,没有收集到有关周围环境的数据。我激活了空间感知和 VR 支持。

4

1 回答 1

0

通过查看 MixedRealityToolkit 中的所有配置文件(GameObject 及其同名脚本),我解决了相同的问题(同类型的其他几个问题)。请注意指示无法找到某些组件的红色标记字段。

在此处输入图像描述

在这种特殊情况下,查看“Spatial Awareness”-Group 内部,复制现有配置文件并使用红色输入字段旁边的Try Fixing 。如果这不起作用,请手动搜索WindowsMixedRealitySpatialMeshObserver

我希望这对你也有帮助。

于 2021-05-26T13:02:18.637 回答