From 336e39c701a7d717b2778e9ad18aa93d7795bb9c Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Sun, 13 Oct 2024 15:17:36 +0200 Subject: [PATCH] Suspend observers --- Assets/Scenes/WebView.unity | 46 ++++++++++++++++++++++- Assets/Scripts/ConfigureObservers.cs | 26 +++++++++++++ Assets/Scripts/ConfigureObservers.cs.meta | 11 ++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 Assets/Scripts/ConfigureObservers.cs create mode 100644 Assets/Scripts/ConfigureObservers.cs.meta diff --git a/Assets/Scenes/WebView.unity b/Assets/Scenes/WebView.unity index 0598e55..d9b78a6 100644 --- a/Assets/Scenes/WebView.unity +++ b/Assets/Scenes/WebView.unity @@ -1288,7 +1288,7 @@ Camera: m_GameObject: {fileID: 963194225} m_Enabled: 1 serializedVersion: 2 - m_ClearFlags: 1 + m_ClearFlags: 2 m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} m_projectionMatrixMode: 1 m_GateFitMode: 2 @@ -1427,6 +1427,50 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1046820063 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1046820065} + - component: {fileID: 1046820064} + m_Layer: 0 + m_Name: SpatialAwarenessController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1046820064 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1046820063} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6e46e82fae789c54faefcee7c2f2ffad, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1046820065 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1046820063} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.02267203, y: -0.03312298, z: 1.1904888} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1100126206 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/ConfigureObservers.cs b/Assets/Scripts/ConfigureObservers.cs new file mode 100644 index 0000000..34b5ef6 --- /dev/null +++ b/Assets/Scripts/ConfigureObservers.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Microsoft.MixedReality.Toolkit; +using Microsoft.MixedReality.Toolkit.SpatialAwareness; + +public class ConfigureObservers : MonoBehaviour +{ + private IMixedRealitySpatialAwarenessSystem spatialAwarenessSystem; + + void Start() + { + spatialAwarenessSystem = MixedRealityToolkit.Instance.GetService(); + + if (spatialAwarenessSystem != null) + { + spatialAwarenessSystem.SuspendObservers(); + Debug.Log("Spatial observers suspended"); + } + else + { + Debug.LogWarning("SAS is not available"); + } + } +} + diff --git a/Assets/Scripts/ConfigureObservers.cs.meta b/Assets/Scripts/ConfigureObservers.cs.meta new file mode 100644 index 0000000..eba8ca6 --- /dev/null +++ b/Assets/Scripts/ConfigureObservers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e46e82fae789c54faefcee7c2f2ffad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: