From 2edf78ec64f8eeb0ae3bf5e690e99aee129c2006 Mon Sep 17 00:00:00 2001 From: Adam Mollis <36461279+AMollis@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:58:47 -0700 Subject: [PATCH] Fixing various warnings with MRTK3 samples (#13) The "EyeLEvelSceneOrigin" warning is a false positive on Editor. The "InteractorBehaviorControls" warning is ignorable, but easy to fix by removing unused field in sample code. The "ScrollablePanel" prefab is missing a required component. --- .../Scripts/InteractorBehaviorControls.cs | 5 --- .../Tracking/UnboundedTrackingMode.cs | 12 ++++-- .../Scrollable/ScrollablePanel.prefab | 39 ++++++++++++++----- 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scripts/InteractorBehaviorControls.cs b/UnityProjects/MRTKDevTemplate/Assets/Scripts/InteractorBehaviorControls.cs index 3ce2160f7..334503f17 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scripts/InteractorBehaviorControls.cs +++ b/UnityProjects/MRTKDevTemplate/Assets/Scripts/InteractorBehaviorControls.cs @@ -66,11 +66,6 @@ public class InteractorBehaviorControls : MonoBehaviour /// public event Action onGazeToggled; - /// - /// event triggered when gaze pinch interactors are toggled on/off - /// - public event Action onGazePinchToggled; - /// /// Enable all interactors /// diff --git a/com.microsoft.mrtk.input/Tracking/UnboundedTrackingMode.cs b/com.microsoft.mrtk.input/Tracking/UnboundedTrackingMode.cs index bf05ef6b6..dc2d0c0ec 100644 --- a/com.microsoft.mrtk.input/Tracking/UnboundedTrackingMode.cs +++ b/com.microsoft.mrtk.input/Tracking/UnboundedTrackingMode.cs @@ -51,28 +51,32 @@ private void OnEnable() XRGeneralSettings xrSettings = XRGeneralSettings.Instance; if (xrSettings == null) { - Debug.LogWarning($"EyeLevelSceneOrigin: XRGeneralSettings is null."); + Debug.LogWarning($"UnboundedTrackingMode: XRGeneralSettings is null."); return; } XRManagerSettings xrManager = xrSettings.Manager; if (xrManager == null) { - Debug.LogWarning($"EyeLevelSceneOrigin: XRManagerSettings is null."); + Debug.LogWarning($"UnboundedTrackingMode: XRManagerSettings is null."); return; } XRLoader xrLoader = xrManager.activeLoader; if (xrLoader == null) { - Debug.LogWarning($"EyeLevelSceneOrigin: XRLoader is null."); + if (!Application.isEditor) + { + // This warning is only actionable on a XR device. + Debug.LogWarning($"UnboundedTrackingMode: XRLoader is null."); + } return; } m_inputSubsystem = xrLoader.GetLoadedSubsystem(); if (m_inputSubsystem == null) { - Debug.LogWarning($"EyeLevelSceneOrigin: XRInputSubsystem is null."); + Debug.LogWarning($"UnboundedTrackingMode: XRInputSubsystem is null."); return; } diff --git a/com.microsoft.mrtk.uxcomponents/Experimental/Scrollable/ScrollablePanel.prefab b/com.microsoft.mrtk.uxcomponents/Experimental/Scrollable/ScrollablePanel.prefab index fcb6cf035..474e6feca 100644 --- a/com.microsoft.mrtk.uxcomponents/Experimental/Scrollable/ScrollablePanel.prefab +++ b/com.microsoft.mrtk.uxcomponents/Experimental/Scrollable/ScrollablePanel.prefab @@ -167,15 +167,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: eventRoutes: - - rid: 4538478793802383364 - - rid: 4538478793802383365 + - rid: 2896949501434265604 + - rid: 2896949501434265605 references: version: 2 RefIds: - - rid: 4538478793802383364 - type: {class: HoverParentEventRoute, ns: MixedReality.Toolkit, asm: MixedReality.Toolkit.Core} - - rid: 4538478793802383365 - type: {class: SelectParentEventRoute, ns: MixedReality.Toolkit, asm: MixedReality.Toolkit.Core} + - rid: 2896949501434265604 + type: {class: BubbleChildHoverEvents, ns: MixedReality.Toolkit.Experimental, asm: MixedReality.Toolkit.Core} + - rid: 2896949501434265605 + type: {class: BubbleChildSelectEvents, ns: MixedReality.Toolkit.Experimental, asm: MixedReality.Toolkit.Core} --- !u!114 &6449560764903005711 MonoBehaviour: m_ObjectHideFlags: 0 @@ -189,7 +189,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_InteractionManager: {fileID: 0} - m_Colliders: [] + m_Colliders: + - {fileID: 6449560764903005707} m_InteractionLayerMask: serializedVersion: 2 m_Bits: 4294967295 @@ -347,7 +348,11 @@ MonoBehaviour: m_Calls: [] disabledInteractorTypes: [] scrollRect: {fileID: 6449560764903005705} - dragDivisor: 10 + moveLerpTime: 0.001 + deadZone: 0.05 + cancelSelectDistance: 0.06 + pokeDeadZone: 0.01 + pokeCancelSelectDistance: 0.02 --- !u!1 &6449560765081929051 GameObject: m_ObjectHideFlags: 0 @@ -422,6 +427,7 @@ GameObject: - component: {fileID: 6449560765461398682} - component: {fileID: 6449560765461398680} - component: {fileID: 6449560765461398683} + - component: {fileID: 4225612563592357419} m_Layer: 5 m_Name: Content m_TagString: Untagged @@ -446,7 +452,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -0.012010826, y: -0.048043303} + m_AnchoredPosition: {x: 0.014124214, y: -0.034411807} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &6449560765461398680 @@ -487,3 +493,18 @@ MonoBehaviour: m_EditorClassIdentifier: m_HorizontalFit: 2 m_VerticalFit: 2 +--- !u!114 &4225612563592357419 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6449560765461398685} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ab638e81f7d2ca34dbf7e36e0294ae12, type: 3} + m_Name: + m_EditorClassIdentifier: + childrenChanged: + m_PersistentCalls: + m_Calls: []