diff --git a/Assets/HoloToolkit-Examples/SpatialUnderstanding/SpatialUnderstanding-FeatureOverview/Scenes/SpatialUnderstandingExample.unity b/Assets/HoloToolkit-Examples/SpatialUnderstanding/SpatialUnderstanding-FeatureOverview/Scenes/SpatialUnderstandingExample.unity index 21b6d16fb9a..5156e5086af 100644 --- a/Assets/HoloToolkit-Examples/SpatialUnderstanding/SpatialUnderstanding-FeatureOverview/Scenes/SpatialUnderstandingExample.unity +++ b/Assets/HoloToolkit-Examples/SpatialUnderstanding/SpatialUnderstanding-FeatureOverview/Scenes/SpatialUnderstandingExample.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 8 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -37,11 +38,11 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657868, g: 0.49641263, b: 0.57481706, a: 1} + m_IndirectSpecularColor: {r: 0.44657886, g: 0.4964128, b: 0.57481706, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 9 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -53,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 4 + serializedVersion: 8 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 @@ -66,13 +67,27 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_DirectLightInLightProbes: 1 m_FinalGather: 0 m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ShadowMaskMode: 2 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -89,6 +104,8 @@ NavMeshSettings: minRegionArea: 2 manualCellSize: 0 cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &81406031 @@ -185,6 +202,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!1 &87500976 GameObject: @@ -493,6 +511,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!1 &381623879 GameObject: @@ -1059,6 +1078,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!1 &903006227 GameObject: @@ -1305,6 +1325,16 @@ Prefab: propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} + - target: {fileID: 114742747811649402, guid: 3eddd1c29199313478dd3f912bfab2ab, + type: 2} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 114708646396671696, guid: 3eddd1c29199313478dd3f912bfab2ab, + type: 2} + propertyPath: autoRegisterGazePointerIfNoPointersRegistered + value: 1 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2} m_IsPrefabParent: 0 @@ -1403,6 +1433,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!1 &1283525608 GameObject: @@ -1665,6 +1696,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fb69de839bd015f4099b5bd2c45e53e5, type: 3} m_Name: m_EditorClassIdentifier: + UseUnscaledTime: 1 PositionPerSecond: 30 RotationDegreesPerSecond: 720 RotationSpeedScaler: 0 @@ -2226,7 +2258,7 @@ Canvas: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1850738765} m_Enabled: 1 - serializedVersion: 2 + serializedVersion: 3 m_RenderMode: 2 m_Camera: {fileID: 0} m_PlaneDistance: 100 @@ -2235,6 +2267,7 @@ Canvas: m_OverrideSorting: 0 m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -2249,6 +2282,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fb69de839bd015f4099b5bd2c45e53e5, type: 3} m_Name: m_EditorClassIdentifier: + UseUnscaledTime: 1 PositionPerSecond: 30 RotationDegreesPerSecond: 720 RotationSpeedScaler: 0 @@ -2473,7 +2507,7 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1991503800} m_Enabled: 1 - serializedVersion: 7 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 @@ -2498,6 +2532,8 @@ Light: m_Lightmapping: 4 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &1991503802 @@ -2506,7 +2542,7 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1991503800} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalRotation: {x: 0.4082179, y: -0.23456971, z: 0.10938164, w: 0.8754262} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] diff --git a/Assets/HoloToolkit/Input/Prefabs/InputManager.prefab b/Assets/HoloToolkit/Input/Prefabs/InputManager.prefab index d29c2e79bf3..c60cbf47fe4 100644 --- a/Assets/HoloToolkit/Input/Prefabs/InputManager.prefab +++ b/Assets/HoloToolkit/Input/Prefabs/InputManager.prefab @@ -24,6 +24,7 @@ GameObject: - component: {fileID: 114000012434513746} - component: {fileID: 114000013868099214} - component: {fileID: 114708646396671696} + - component: {fileID: 114742747811649402} m_Layer: 0 m_Name: InputManager m_TagString: Untagged @@ -64,6 +65,22 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 +--- !u!1 &1834357620357688 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + serializedVersion: 5 + m_Component: + - component: {fileID: 4532035439910448} + - component: {fileID: 114345042324023316} + m_Layer: 0 + m_Name: ControllerPointerStabilizer + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 --- !u!4 &4000010261267946 Transform: m_ObjectHideFlags: 1 @@ -89,6 +106,7 @@ Transform: m_Children: - {fileID: 4000013985985722} - {fileID: 4000010261267946} + - {fileID: 4532035439910448} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -105,6 +123,19 @@ Transform: m_Father: {fileID: 4000011656901714} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!4 &4532035439910448 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1834357620357688} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4000011656901714} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &114000011980027866 MonoBehaviour: m_ObjectHideFlags: 1 @@ -179,6 +210,18 @@ MonoBehaviour: UseGazeManager: 1 DefaultPlaneDistance: 2 DrawGizmos: 0 +--- !u!114 &114345042324023316 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1834357620357688} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b81e3e700505863408cacaa0346cb1a6, type: 3} + m_Name: + m_EditorClassIdentifier: + StoredStabilitySamples: 60 --- !u!114 &114708646396671696 MonoBehaviour: m_ObjectHideFlags: 1 @@ -195,10 +238,24 @@ MonoBehaviour: - serializedVersion: 2 m_Bits: 4294967291 autoRegisteredPointers: [] - autoRegisterGazePointerIfNoPointersRegistered: 1 + autoRegisterGazePointerIfNoPointersRegistered: 0 autoRegisteredPointableCanvases: [] DebugDrawPointingRays: 0 DebugDrawPointingRayColors: [] +--- !u!114 &114742747811649402 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 1000011070707148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3a23bf9a6a8497a4490fdbd42c41357e, type: 3} + m_Name: + m_EditorClassIdentifier: + ControllerPointerStabilizer: {fileID: 114345042324023316} + Cursor: {fileID: 0} + SearchForCursorIfUnset: 1 --- !u!114 &114902642943532050 MonoBehaviour: m_ObjectHideFlags: 1 diff --git a/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs b/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs index dded9697214..3ab48a75878 100644 --- a/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs +++ b/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs @@ -54,12 +54,10 @@ public enum CursorStateEnum public CursorStateEnum CursorState { get { return cursorState; } } private CursorStateEnum cursorState = CursorStateEnum.None; -#pragma warning disable 0649 [Tooltip("Set this in the editor to an object with a component that implements IPointerSource to tell this" + " cursor which pointer to follow. To set the pointer programmatically, set Pointer directly.")] [SerializeField] - private GameObject loadPointer; -#pragma warning restore 0649 + protected GameObject loadPointer; /// /// The pointer that this cursor should follow and process input from. @@ -230,10 +228,7 @@ protected virtual void RegisterManagers() InputManager.Instance.InputEnabled += OnInputEnabled; InputManager.Instance.InputDisabled += OnInputDisabled; - if (FocusManager.IsInitialized) - { - FocusManager.Instance.PointerSpecificFocusChanged += OnPointerSpecificFocusChanged; - } + FocusManager.Instance.PointerSpecificFocusChanged += OnPointerSpecificFocusChanged; } /// @@ -278,16 +273,10 @@ private void TryLoadPointerIfNeeded() // pointer currently registered with FocusManager, we use it. Pointer = FocusManager.Instance.TryGetSinglePointer(); - - if (Pointer == null) - { - Pointer = GazeManager.Instance; - } } else { - gameObject.AddComponent(); - Pointer = FocusManager.Instance.TryGetSinglePointer(); + // No options available, so we leave Pointer unset. It will need to be set programmatically later. } } diff --git a/Assets/HoloToolkit/Input/Scripts/Focus/FocusManager.cs b/Assets/HoloToolkit/Input/Scripts/Focus/FocusManager.cs index 6e0dffc3a6b..c250f543546 100644 --- a/Assets/HoloToolkit/Input/Scripts/Focus/FocusManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Focus/FocusManager.cs @@ -114,6 +114,17 @@ public void UpdateHit(float extent) Object = null, }; } + + public void ResetFocusedObjects() + { + PreviousEndObject = null; + End = new FocusDetails + { + Point = End.Point, + Normal = End.Normal, + Object = null, + }; + } } private readonly List pointers = new List(); @@ -126,7 +137,7 @@ public void UpdateHit(float extent) private readonly List pointableCanvases = new List(); private Camera uiRaycastCamera; - private PointerEventData uiRaycastPointerData; + private PointerInputEventData uiRaycastPointerInputData; private List uiRaycastResults; private readonly HashSet pendingOverallFocusEnterSet = new HashSet(); @@ -156,6 +167,10 @@ public void RegisterPointer(IPointingSource pointingSource) { gazeManagerPointingData = new PointerData(pointingSource); } + else + { + gazeManagerPointingData.ResetFocusedObjects(); + } pointer = gazeManagerPointingData; } @@ -280,18 +295,23 @@ public IPointingSource TryGetSinglePointer() public delegate void PointerSpecificFocusChangedMethod(IPointingSource pointer, GameObject oldFocusedObject, GameObject newFocusedObject); public event PointerSpecificFocusChangedMethod PointerSpecificFocusChanged; - public PointerEventData BorrowPointerEventData() + public PointerInputEventData BorrowPointerEventData() { - if (uiRaycastPointerData == null) + if (uiRaycastPointerInputData == null) { - uiRaycastPointerData = new PointerEventData(EventSystem.current); + uiRaycastPointerInputData = new PointerInputEventData(EventSystem.current); } else { - Clear(uiRaycastPointerData); + Clear(uiRaycastPointerInputData); } + + return uiRaycastPointerInputData; + } - return uiRaycastPointerData; + public float GetPointingExtent(IPointingSource pointingSource) + { + return GetPointingExtent(GetPointer(pointingSource)); } #endregion @@ -433,7 +453,7 @@ private void UpdatePointing(PointerData pointer) pointer.PointingSource.UpdatePointer(); Ray pointingRay = pointer.PointingSource.Ray; - float extent = (pointer.PointingSource.ExtentOverride ?? pointingExtent); + float extent = GetPointingExtent(pointer); IList prioritizedLayerMasks = (pointer.PointingSource.PrioritizedLayerMasksOverride ?? pointingPrioritizedLayerMasks); LayerMask combinedLayerMasks = GetCombinedLayerMask(prioritizedLayerMasks); @@ -485,9 +505,9 @@ private void UpdatePointing(PointerData pointer) canvas.worldCamera = uiRaycastCamera; } - if (uiRaycastPointerData == null) + if (uiRaycastPointerInputData == null) { - uiRaycastPointerData = new PointerEventData(EventSystem.current); + uiRaycastPointerInputData = new PointerInputEventData(EventSystem.current); } Debug.Assert(uiRaycastResults == null); @@ -495,7 +515,7 @@ private void UpdatePointing(PointerData pointer) } Debug.Assert(uiRaycastCamera != null); - Debug.Assert(uiRaycastPointerData != null); + Debug.Assert(uiRaycastPointerInputData != null); Debug.Assert(uiRaycastResults != null); foreach (Canvas canvas in pointableCanvases) @@ -506,12 +526,12 @@ private void UpdatePointing(PointerData pointer) uiRaycastCamera.transform.position = pointingRay.origin; uiRaycastCamera.transform.forward = pointingRay.direction; - Clear(uiRaycastPointerData); - uiRaycastPointerData.position = new Vector2((uiRaycastCamera.pixelWidth / 2), (uiRaycastCamera.pixelHeight / 2)); + Clear(uiRaycastPointerInputData); + uiRaycastPointerInputData.position = new Vector2((uiRaycastCamera.pixelWidth / 2), (uiRaycastCamera.pixelHeight / 2)); uiRaycastResults.Clear(); - EventSystem.current.RaycastAll(uiRaycastPointerData, uiRaycastResults); + EventSystem.current.RaycastAll(uiRaycastPointerInputData, uiRaycastResults); uiHit = TryGetPreferredHit(uiRaycastResults, prioritizedLayerMasks); if (uiHit != null) @@ -739,6 +759,11 @@ private PointerData GetPointer(IPointingSource pointingSource) return found; } + private float GetPointingExtent(PointerData pointer) + { + return (pointer.PointingSource.ExtentOverride ?? pointingExtent); + } + private RaycastHit? TryGetPreferredHit(IList orderedHits, IList prioritizedLayerMasks) { Debug.Assert(orderedHits != null); @@ -878,26 +903,28 @@ private LayerMask GetCombinedLayerMask(IList toCombine) private void Clear(PointerEventData pointerEventData) { - uiRaycastPointerData.Reset(); - - uiRaycastPointerData.button = PointerEventData.InputButton.Left; - uiRaycastPointerData.clickCount = 0; - uiRaycastPointerData.clickTime = 0; - uiRaycastPointerData.delta = Vector2.zero; - uiRaycastPointerData.dragging = false; - uiRaycastPointerData.eligibleForClick = false; - uiRaycastPointerData.pointerCurrentRaycast = default(RaycastResult); - uiRaycastPointerData.pointerDrag = null; - uiRaycastPointerData.pointerEnter = null; - uiRaycastPointerData.pointerId = 0; - uiRaycastPointerData.pointerPress = null; - uiRaycastPointerData.pointerPressRaycast = default(RaycastResult); - uiRaycastPointerData.position = Vector2.zero; - uiRaycastPointerData.pressPosition = Vector2.zero; - uiRaycastPointerData.rawPointerPress = null; - uiRaycastPointerData.scrollDelta = Vector2.zero; - uiRaycastPointerData.selectedObject = null; - uiRaycastPointerData.useDragThreshold = false; + uiRaycastPointerInputData.Reset(); + + uiRaycastPointerInputData.button = PointerEventData.InputButton.Left; + uiRaycastPointerInputData.clickCount = 0; + uiRaycastPointerInputData.clickTime = 0; + uiRaycastPointerInputData.delta = Vector2.zero; + uiRaycastPointerInputData.dragging = false; + uiRaycastPointerInputData.eligibleForClick = false; + uiRaycastPointerInputData.pointerCurrentRaycast = default(RaycastResult); + uiRaycastPointerInputData.pointerDrag = null; + uiRaycastPointerInputData.pointerEnter = null; + uiRaycastPointerInputData.pointerId = 0; + uiRaycastPointerInputData.pointerPress = null; + uiRaycastPointerInputData.pointerPressRaycast = default(RaycastResult); + uiRaycastPointerInputData.position = Vector2.zero; + uiRaycastPointerInputData.pressPosition = Vector2.zero; + uiRaycastPointerInputData.rawPointerPress = null; + uiRaycastPointerInputData.scrollDelta = Vector2.zero; + uiRaycastPointerInputData.selectedObject = null; + uiRaycastPointerInputData.useDragThreshold = false; + uiRaycastPointerInputData.InputSource = null; + uiRaycastPointerInputData.SourceId = 0; } #endregion diff --git a/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs b/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs index a5d7d6ab0ca..7dcc682449a 100644 --- a/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs +++ b/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs @@ -65,7 +65,7 @@ public bool OwnsInput(BaseEventData eventData) public bool InputIsFromSource(BaseEventData eventData) { - var inputData = (eventData as BaseInputEventData); + var inputData = (eventData as IInputSourceInfoProvider); return (inputData != null) && (inputData.InputSource == InputSource) diff --git a/Assets/HoloToolkit/Input/Scripts/Focus/SimpleSinglePointerSelector.cs b/Assets/HoloToolkit/Input/Scripts/Focus/SimpleSinglePointerSelector.cs index d61dc91a660..58f47443f9a 100644 --- a/Assets/HoloToolkit/Input/Scripts/Focus/SimpleSinglePointerSelector.cs +++ b/Assets/HoloToolkit/Input/Scripts/Focus/SimpleSinglePointerSelector.cs @@ -55,7 +55,7 @@ private void Start() FindCursorIfNeeded(); ConnectBestAvailablePointer(); - Debug.Assert(currentPointer != null); + Debug.Assert(currentPointer != null, this); } private void OnEnable() @@ -134,6 +134,7 @@ private void FindCursorIfNeeded() if ((Cursor == null) && SearchForCursorIfUnset) { Debug.LogWarningFormat( + this, "Cursor hasn't been explicitly set on \"{0}.{1}\". We'll search for a cursor in the hierarchy, but" + " that comes with a performance cost, so it would be best if you explicitly set the cursor.", name, @@ -144,11 +145,12 @@ private void FindCursorIfNeeded() if ((foundCursors == null) || (foundCursors.Length == 0)) { - Debug.LogErrorFormat("Couldn't find cursor for \"{0}.{1}\".", name, GetType().Name); + Debug.LogErrorFormat(this, "Couldn't find cursor for \"{0}.{1}\".", name, GetType().Name); } else if (foundCursors.Length > 1) { Debug.LogErrorFormat( + this, "Found more than one ({0}) cursors for \"{1}.{2}\", so couldn't automatically set one.", foundCursors.Length, name, diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/BaseInputEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/BaseInputEventData.cs index 91fe854b870..b1f48606707 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputEventData/BaseInputEventData.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/BaseInputEventData.cs @@ -8,7 +8,7 @@ namespace HoloToolkit.Unity.InputModule /// /// Base class of all input events. /// - public abstract class BaseInputEventData : BaseEventData + public abstract class BaseInputEventData : BaseEventData, IInputSourceInfoProvider { /// /// The source the input event originates from. diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/PointerInputEventData.cs b/Assets/HoloToolkit/Input/Scripts/InputEventData/PointerInputEventData.cs new file mode 100644 index 00000000000..1c55a317cb5 --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/PointerInputEventData.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using UnityEngine.EventSystems; + +namespace HoloToolkit.Unity.InputModule +{ + /// + /// Describes a Unity pointer event that was generated by a specific input source and ID. + /// + public class PointerInputEventData : + PointerEventData, + IInputSourceInfoProvider + { + public IInputSource InputSource { get; set; } + + public uint SourceId { get; set; } + + public PointerInputEventData(EventSystem eventSystem) : base(eventSystem) + { + } + } +} \ No newline at end of file diff --git a/Assets/HoloToolkit/Input/Scripts/InputEventData/PointerInputEventData.cs.meta b/Assets/HoloToolkit/Input/Scripts/InputEventData/PointerInputEventData.cs.meta new file mode 100644 index 00000000000..4f5435680cc --- /dev/null +++ b/Assets/HoloToolkit/Input/Scripts/InputEventData/PointerInputEventData.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ff6f20e9d13ec684d8a2f89b39ed394f +timeCreated: 1490899610 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Input/Scripts/InputManager.cs b/Assets/HoloToolkit/Input/Scripts/InputManager.cs index b889d665a12..eb878a8e5ba 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputManager.cs @@ -16,13 +16,6 @@ namespace HoloToolkit.Unity.InputModule /// public class InputManager : Singleton { - /// - /// To tap on a hologram even when not focused on, - /// set OverrideFocusedObject to desired game object. - /// If it's null, then focused object will be used. - /// - public GameObject OverrideFocusedObject { get; set; } - public event Action InputEnabled; public event Action InputDisabled; @@ -197,8 +190,8 @@ public void RaiseFocusEnter(GameObject focusedObject) if (ShouldSendUnityUiEvents) { - PointerEventData pointerEventData = FocusManager.Instance.BorrowPointerEventData(); - ExecuteEvents.ExecuteHierarchy(focusedObject, pointerEventData, ExecuteEvents.pointerEnterHandler); + PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); + ExecuteEvents.ExecuteHierarchy(focusedObject, pointerInputEventData, ExecuteEvents.pointerEnterHandler); } } @@ -212,8 +205,8 @@ public void RaiseFocusExit(GameObject defocusedObject) if (ShouldSendUnityUiEvents) { - PointerEventData pointerEventData = FocusManager.Instance.BorrowPointerEventData(); - ExecuteEvents.ExecuteHierarchy(defocusedObject, pointerEventData, ExecuteEvents.pointerExitHandler); + PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); + ExecuteEvents.ExecuteHierarchy(defocusedObject, pointerInputEventData, ExecuteEvents.pointerExitHandler); } } @@ -238,8 +231,9 @@ public void RaisePointerSpecificFocusChangedEvents(IPointingSource pointer, Game } } - private void Start() + protected override void Awake() { + base.Awake(); InitializeEventDatas(); } @@ -267,7 +261,7 @@ public void HandleEvent(BaseEventData eventData, ExecuteEvents.EventFunction< } Debug.Assert(!eventData.used); - GameObject focusedObject = (OverrideFocusedObject == null) ? FocusManager.Instance.TryGetFocusedObject(eventData) : OverrideFocusedObject; + GameObject focusedObject = FocusManager.Instance.TryGetFocusedObject(eventData); // Send the event to global listeners for (int i = 0; i < globalListeners.Count; i++) @@ -392,9 +386,12 @@ public void RaiseSourceUp(IInputSource source, uint sourceId, InteractionPressKi // UI events if (ShouldSendUnityUiEvents && (pressKind == InteractionPressKind.Select)) { - PointerEventData pointerEventData = FocusManager.Instance.BorrowPointerEventData(); - HandleEvent(pointerEventData, ExecuteEvents.pointerUpHandler); - HandleEvent(pointerEventData, ExecuteEvents.pointerClickHandler); + PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); + pointerInputEventData.InputSource = source; + pointerInputEventData.SourceId = sourceId; + + HandleEvent(pointerInputEventData, ExecuteEvents.pointerUpHandler); + HandleEvent(pointerInputEventData, ExecuteEvents.pointerClickHandler); } } @@ -416,16 +413,18 @@ public void RaiseSourceDown(IInputSource source, uint sourceId, InteractionPress // UI events if (ShouldSendUnityUiEvents && (pressKind == InteractionPressKind.Select)) { - PointerEventData pointerEventData = FocusManager.Instance.BorrowPointerEventData(); + PointerInputEventData pointerInputEventData = FocusManager.Instance.BorrowPointerEventData(); + pointerInputEventData.InputSource = source; + pointerInputEventData.SourceId = sourceId; - pointerEventData.eligibleForClick = true; - pointerEventData.delta = Vector2.zero; - pointerEventData.dragging = false; - pointerEventData.useDragThreshold = true; - pointerEventData.pressPosition = pointerEventData.position; - pointerEventData.pointerPressRaycast = pointerEventData.pointerCurrentRaycast; + pointerInputEventData.eligibleForClick = true; + pointerInputEventData.delta = Vector2.zero; + pointerInputEventData.dragging = false; + pointerInputEventData.useDragThreshold = true; + pointerInputEventData.pressPosition = pointerInputEventData.position; + pointerInputEventData.pointerPressRaycast = pointerInputEventData.pointerCurrentRaycast; - HandleEvent(pointerEventData, ExecuteEvents.pointerDownHandler); + HandleEvent(pointerInputEventData, ExecuteEvents.pointerDownHandler); } } diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/GesturesInput.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/GesturesInput.cs index 3b42bd60a53..b5ebf66f59d 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/GesturesInput.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/GesturesInput.cs @@ -526,6 +526,9 @@ private void UpdateSourceState(InteractionSourceState interactionSource, SourceD { if (!(sourceData.Position.CurrentReading.Equals(newPosition))) { + // TODO: Raising events here may cause reentrancy complexity. Consider delaying all event-raising till + // after all updates are stored. Alternatively, consider switching from polling to responding to + // InteractionManager events. InputManager.Instance.RaiseSourcePositionChanged(this, sourceData.SourceId, newPosition); } } @@ -544,10 +547,8 @@ private void UpdateSourceState(InteractionSourceState interactionSource, SourceD } sourceData.Rotation.CurrentReading = newRotation; - Ray newPointerRay; sourceData.PointingRay.IsSupported = interactionSource.source.supportsPointing; - sourceData.PointingRay.IsAvailable = sourcePose.TryGetPointerRay(out newPointerRay) && newPointerRay.IsValid(); - sourceData.PointingRay.CurrentReading = newPointerRay; + sourceData.PointingRay.IsAvailable = sourcePose.TryGetPointerRay(out sourceData.PointingRay.CurrentReading); InteractionController controller; bool gotController = interactionSource.source.TryGetController(out controller); diff --git a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs index 9094f8b4045..c76deefe1a4 100644 --- a/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/InputSources/IInputSource.cs @@ -7,19 +7,6 @@ namespace HoloToolkit.Unity.InputModule { - /// - /// Flags used to indicate which input events are supported by an input source. - /// - [Flags] - public enum SupportedInputEvents - { - SourceUpAndDown = (1 << 0), - SourceClicked = (1 << 1), - Hold = (1 << 2), - Manipulation = (1 << 3), - Navigation = (1 << 4) - } - /// /// Flags used to indicate which input information is supported by an input source. /// diff --git a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs b/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs index 28869fa813e..0417a694a0a 100644 --- a/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs +++ b/Assets/HoloToolkit/Input/Scripts/Utilities/InputSourceInfo.cs @@ -1,13 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; + namespace HoloToolkit.Unity.InputModule { /// /// InputSourceInfo gives you the input source like hands or motion controller. /// It will also report the source id for that source. /// - public struct InputSourceInfo + public struct InputSourceInfo : + IInputSourceInfoProvider { public IInputSource InputSource; public uint SourceId; @@ -19,9 +22,34 @@ public InputSourceInfo(IInputSource inputSource, uint sourceId) : SourceId = sourceId; } + IInputSource IInputSourceInfoProvider.InputSource + { + get { return InputSource; } + } + + uint IInputSourceInfoProvider.SourceId + { + get { return SourceId; } + } + + public bool Matches(IInputSourceInfoProvider other) + { + return ((other != null) && Matches(other.InputSource, other.SourceId)); + } + public bool Matches(IInputSource otherInputSource, uint otherSourceId) { return ((InputSource == otherInputSource) && (SourceId == otherSourceId)); } } + + /// + /// IInputSourceInfoProvider gives you the input source like hands or motion controller. + /// It will also report the source id for that source. + /// + public interface IInputSourceInfoProvider + { + IInputSource InputSource { get; } + uint SourceId { get; } + } } diff --git a/Assets/HoloToolkit/Input/Tests/Scenes/InputManagerTest.unity b/Assets/HoloToolkit/Input/Tests/Scenes/InputManagerTest.unity index b5c7b641565..935951fdc9b 100644 --- a/Assets/HoloToolkit/Input/Tests/Scenes/InputManagerTest.unity +++ b/Assets/HoloToolkit/Input/Tests/Scenes/InputManagerTest.unity @@ -1692,48 +1692,6 @@ Animator: m_PrefabParentObject: {fileID: 95000013881968268, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_PrefabInternal: {fileID: 1550965883} ---- !u!1001 &525736251 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4000010560871102, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - propertyPath: m_RootOrder - value: 1 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: d379ed0a5618c9f479f58bd83a2d0ad3, type: 2} - m_IsPrefabParent: 0 --- !u!95 &526292728 stripped Animator: m_PrefabParentObject: {fileID: 95000013881968268, guid: b3364a8b0a2a96a43b662045118b0a9e, @@ -2247,6 +2205,12 @@ Transform: m_PrefabParentObject: {fileID: 4000014213108822, guid: b3364a8b0a2a96a43b662045118b0a9e, type: 2} m_PrefabInternal: {fileID: 1637635550} +--- !u!114 &763781730 stripped +MonoBehaviour: + m_PrefabParentObject: {fileID: 114611684728110934, guid: a611e772ef8ddf64d8106a9cbb70f31c, + type: 2} + m_PrefabInternal: {fileID: 873989050} + m_Script: {fileID: 11500000, guid: 0decd33ba8702954885a62b5bc1a778e, type: 3} --- !u!1 &764860894 GameObject: m_ObjectHideFlags: 0 @@ -3995,6 +3959,11 @@ Prefab: propertyPath: m_RootOrder value: 1 objectReference: {fileID: 0} + - target: {fileID: 114742747811649402, guid: 3eddd1c29199313478dd3f912bfab2ab, + type: 2} + propertyPath: Cursor + value: + objectReference: {fileID: 763781730} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2} m_IsPrefabParent: 0 @@ -5099,6 +5068,53 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 +--- !u!1001 &1750729654 +Prefab: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4541142303025740, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114092548863884916, guid: d29bc40b7f3df26479d6a0aac211c355, + type: 2} + propertyPath: EnableTeleport + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_ParentPrefab: {fileID: 100100000, guid: d29bc40b7f3df26479d6a0aac211c355, type: 2} + m_IsPrefabParent: 0 --- !u!95 &1753714861 stripped Animator: m_PrefabParentObject: {fileID: 95000013881968268, guid: b3364a8b0a2a96a43b662045118b0a9e, diff --git a/Assets/HoloToolkit/Input/Tests/Scenes/OverrideFocusedObjectTest.unity b/Assets/HoloToolkit/Input/Tests/Scenes/OverrideFocusedObjectTest.unity index 33429a8849f..b8ff96ebdbd 100644 --- a/Assets/HoloToolkit/Input/Tests/Scenes/OverrideFocusedObjectTest.unity +++ b/Assets/HoloToolkit/Input/Tests/Scenes/OverrideFocusedObjectTest.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 8 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -37,11 +38,11 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657874, g: 0.4964127, b: 0.5748172, a: 1} + m_IndirectSpecularColor: {r: 0.44657886, g: 0.4964128, b: 0.57481706, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 9 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -53,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 4 + serializedVersion: 8 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 @@ -66,13 +67,27 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_DirectLightInLightProbes: 1 m_FinalGather: 0 m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ShadowMaskMode: 2 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -89,6 +104,8 @@ NavMeshSettings: minRegionArea: 2 manualCellSize: 0 cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &10687557 @@ -114,7 +131,7 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 10687557} m_Enabled: 1 - serializedVersion: 7 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 @@ -139,6 +156,8 @@ Light: m_Lightmapping: 4 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &10687559 @@ -147,7 +166,7 @@ Transform: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 10687557} - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalRotation: {x: 0.4082179, y: -0.23456971, z: 0.10938164, w: 0.8754262} m_LocalPosition: {x: 0, y: 3, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] @@ -217,6 +236,7 @@ GameObject: - component: {fileID: 221526973} - component: {fileID: 221526972} - component: {fileID: 221526975} + - component: {fileID: 221526976} m_Layer: 0 m_Name: TestMessages m_TagString: Untagged @@ -231,7 +251,7 @@ TextMesh: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 221526971} - m_Text: Hello World + m_Text: The click handler was called 0 times. Currently, focus is not overridden. m_OffsetZ: 0 m_CharacterSize: 1 m_LineSpacing: 1 @@ -275,6 +295,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!4 &221526974 Transform: @@ -300,6 +321,18 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: cac20ddb16c1fe54cac9ae87c0d6680c, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!65 &221526976 +BoxCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 221526971} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 41.5, y: 1.4523438, z: 0} + m_Center: {x: 20.75, y: -0.7261719, z: -0} --- !u!1 &774281391 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/HoloToolkit/Input/Tests/Scripts/TestOverrideFocusedObject.cs b/Assets/HoloToolkit/Input/Tests/Scripts/TestOverrideFocusedObject.cs index f4034446b14..d5dd72863d1 100644 --- a/Assets/HoloToolkit/Input/Tests/Scripts/TestOverrideFocusedObject.cs +++ b/Assets/HoloToolkit/Input/Tests/Scripts/TestOverrideFocusedObject.cs @@ -7,25 +7,65 @@ public class TestOverrideFocusedObject : MonoBehaviour, IInputClickHandler InputManager inputManager; TextMesh textMesh; + int clickCount; + bool isOverridingFocus; + void Start() { inputManager = InputManager.Instance; if (inputManager != null) { - inputManager.OverrideFocusedObject = gameObject; + OverrideFocus(); } textMesh = GameObject.FindObjectOfType(); + + if (textMesh != null) + { + UpdateText(); + } } public void OnInputClicked(InputClickedEventData eventData) { if (textMesh != null && inputManager != null) { - textMesh.text = "Air tap worked and OverrideFocusedObject is null."; - inputManager.OverrideFocusedObject = null; + clickCount++; + + if (isOverridingFocus) + { + UndoOverrideFocus(); + } + else + { + OverrideFocus(); + } + + UpdateText(); + + eventData.Use(); } } + + private void OverrideFocus() + { + inputManager.AddGlobalListener(gameObject); + isOverridingFocus = true; + } + + private void UndoOverrideFocus() + { + inputManager.RemoveGlobalListener(gameObject); + isOverridingFocus = false; + } + + private void UpdateText() + { + textMesh.text = string.Format("The click handler was called {0} times. Currently, focus is {1}.", + clickCount, + isOverridingFocus ? "overridden" : "not overridden" + ); + } } } \ No newline at end of file diff --git a/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs b/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs index 524955836c7..6c3633c744a 100644 --- a/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs +++ b/Assets/HoloToolkit/SharingWithUNET/Scripts/UNetSharedHologram.cs @@ -98,7 +98,7 @@ public void OnInputClicked(InputClickedEventData eventData) Moving = !Moving; if (Moving) { - inputManager.OverrideFocusedObject = this.gameObject; + inputManager.AddGlobalListener(gameObject); if (SpatialMappingManager.Instance != null) { SpatialMappingManager.Instance.DrawVisualMeshes = true; @@ -106,7 +106,7 @@ public void OnInputClicked(InputClickedEventData eventData) } else { - inputManager.OverrideFocusedObject = null; + inputManager.RemoveGlobalListener(gameObject); if (SpatialMappingManager.Instance != null) { SpatialMappingManager.Instance.DrawVisualMeshes = false; @@ -121,6 +121,8 @@ public void OnInputClicked(InputClickedEventData eventData) PlayerController.Instance.SendSharedTransform(this.gameObject, localPosition, localRotation); } } + + eventData.Use(); } } } diff --git a/Assets/HoloToolkit/SpatialMapping/Tests/Scenes/PlaneFinding.unity b/Assets/HoloToolkit/SpatialMapping/Tests/Scenes/PlaneFinding.unity index 0b21eaa6006..7c54429e0be 100644 --- a/Assets/HoloToolkit/SpatialMapping/Tests/Scenes/PlaneFinding.unity +++ b/Assets/HoloToolkit/SpatialMapping/Tests/Scenes/PlaneFinding.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 8 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -37,11 +38,11 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44657844, g: 0.49641222, b: 0.57481694, a: 1} + m_IndirectSpecularColor: {r: 0.44657892, g: 0.4964128, b: 0.5748171, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 9 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -53,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 4 + serializedVersion: 8 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 @@ -66,13 +67,27 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_DirectLightInLightProbes: 1 m_FinalGather: 0 m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ShadowMaskMode: 2 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -89,6 +104,8 @@ NavMeshSettings: minRegionArea: 2 manualCellSize: 0 cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1001 &633271948 @@ -200,7 +217,7 @@ Light: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 761731819} m_Enabled: 1 - serializedVersion: 7 + serializedVersion: 8 m_Type: 1 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 @@ -225,6 +242,8 @@ Light: m_Lightmapping: 4 m_AreaSize: {x: 1, y: 1} m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 --- !u!4 &761731821 @@ -326,6 +345,11 @@ Prefab: propertyPath: m_RootOrder value: 3 objectReference: {fileID: 0} + - target: {fileID: 114742747811649402, guid: 3eddd1c29199313478dd3f912bfab2ab, + type: 2} + propertyPath: SearchForCursorIfUnset + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/HoloToolkit/Utilities/Scripts/Extensions/Extensions.cs b/Assets/HoloToolkit/Utilities/Scripts/Extensions/Extensions.cs index db813e938fb..61d55cfaaad 100644 --- a/Assets/HoloToolkit/Utilities/Scripts/Extensions/Extensions.cs +++ b/Assets/HoloToolkit/Utilities/Scripts/Extensions/Extensions.cs @@ -1,6 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; using UnityEngine; namespace HoloToolkit.Unity @@ -35,6 +39,138 @@ public static bool IsValid(this Ray ray) return (ray.direction != Vector3.zero); } + #region Collections + + /// + /// Creates a read-only wrapper around an existing collection. + /// + /// The type of element in the collection. + /// The collection to be wrapped. + /// The new, read-only wrapper around . + public static ReadOnlyCollection AsReadOnly(this IList elements) + { + return new ReadOnlyCollection(elements); + } + + /// + /// Creates a read-only copy of an existing collection. + /// + /// The type of element in the collection. + /// The collection to be copied. + /// The new, read-only copy of . + public static ReadOnlyCollection ToReadOnlyCollection(this IEnumerable elements) + { + return elements.ToArray().AsReadOnly(); + } + + /// + /// Inserts an item in its sorted position into an already sorted collection. This is useful if you need to consume the + /// collection in between insertions and need it to stay correctly sorted the whole time. If you just need to insert a + /// bunch of items and then consume the sorted collection at the end, it's faster to add all the elements and then use + /// at the end. + /// + /// The type of element in the collection. + /// The collection of sorted elements to be inserted into. + /// The element to insert. + /// The comparer to use when sorting or to use . + /// + public static int SortedInsert(this List elements, TElement toInsert, IComparer comparer = null) + { + var effectiveComparer = (comparer ?? Comparer.Default); + +#if DEBUG || UNITY_EDITOR + for (int iElement = 0; iElement < (elements.Count - 1); iElement++) + { + var element = elements[iElement]; + var nextElement = elements[iElement + 1]; + + if (effectiveComparer.Compare(element, nextElement) > 0) + { + Debug.Assert(false, "elements must already be sorted to call this method."); + break; + } + } +#endif + + int searchResult = elements.BinarySearch(toInsert, effectiveComparer); + + int insertionIndex = (searchResult >= 0) + ? searchResult + : (~searchResult); + + elements.Insert(insertionIndex, toInsert); + + return insertionIndex; + } + + /// + /// Disposes of all non-null elements in a collection. + /// + /// The type of element in the collection. + /// The collection of elements to be disposed. + public static void DisposeElements(this IEnumerable elements) + where TElement : IDisposable + { + foreach (var element in elements) + { + if (element != null) + { + element.Dispose(); + } + } + } + + /// + /// Disposes of all non-null elements in a collection. + /// + /// The type of element in the collection. + /// The collection of elements to be disposed. + public static void DisposeElements(this IList elements) + where TElement : IDisposable + { + for (int iElement = 0; iElement < elements.Count; iElement++) + { + var element = elements[iElement]; + + if (element != null) + { + element.Dispose(); + } + } + } + + #endregion + + #region Numerics + + /// + /// Checks if two numbers are approximately equal. Similar to , but the tolerance + /// can be specified. + /// + /// One of the numbers to compare. + /// The other number to compare. + /// The amount of tolerance to allow while still considering the numbers approximately equal. + /// True if the difference between the numbers is less than or equal to the tolerance, false otherwise. + public static bool Approximately(this float number, float other, float tolerance) + { + return (Mathf.Abs(number - other) <= tolerance); + } + + /// + /// Checks if two numbers are approximately equal. Similar to , but the tolerance + /// can be specified. + /// + /// One of the numbers to compare. + /// The other number to compare. + /// The amount of tolerance to allow while still considering the numbers approximately equal. + /// True if the difference between the numbers is less than or equal to the tolerance, false otherwise. + public static bool Approximately(this double number, double other, double tolerance) + { + return (Math.Abs(number - other) <= tolerance); + } + + #endregion + #region GameObject /// @@ -50,5 +186,38 @@ public static bool IsInLayerMask(this GameObject gameObject, LayerMask layerMask } #endregion + + #region Comparer + + /// + /// Gets a comparer that sorts elements in the opposite order of the original comparer. + /// + /// The type of element the comparer compares. + /// The comparer whose order should be reversed. + /// A comparer that sorts elements in the opposite order of . + public static IComparer GetReversed(this IComparer originalComparer) + { + return new ReverseComparer(originalComparer); + } + + private class ReverseComparer : + IComparer + { + private readonly IComparer originalComparer; + + public ReverseComparer(IComparer originalComparer) + { + Debug.Assert(originalComparer != null, "originalComparer cannot be null."); + + this.originalComparer = originalComparer; + } + + public int Compare(TElement left, TElement right) + { + return originalComparer.Compare(right, left); + } + } + + #endregion } } diff --git a/Assets/HoloToolkit/Utilities/Scripts/HashCodes.cs b/Assets/HoloToolkit/Utilities/Scripts/HashCodes.cs new file mode 100644 index 00000000000..0fbf6e4327f --- /dev/null +++ b/Assets/HoloToolkit/Utilities/Scripts/HashCodes.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace HoloToolkit.Unity +{ + /// + /// Provides helper methods for combining hash codes of many properties or objects into an + /// aggregated hash code. + /// + public static class HashCodes + { + public static int Combine(int first, int second) + { + // This algorithm is based on .Net 4.6.1's implementation of Tuple. + return (((first << 5) + first) ^ second); + } + + // NOTE: The following are generic to avoid boxing structs: + + public static int FromNullable(T1 toHash) + { + return (toHash == null) + ? 0 + : toHash.GetHashCode(); + } + + public static int Combine(T1 first, T2 second) + { + return Combine(FromNullable(first), FromNullable(second)); + } + + public static int Combine(T1 first, T2 second, T3 third) + { + return Combine(Combine(first, second), FromNullable(third)); + } + + public static int Combine(T1 first, T2 second, T3 third, T4 fourth) + { + return Combine(Combine(first, second, third), FromNullable(fourth)); + } + + public static int Combine(T1 first, T2 second, T3 third, T4 fourth, T5 fifth) + { + return Combine(Combine(first, second, third, fourth), FromNullable(fifth)); + } + + public static int Combine(T1 first, T2 second, T3 third, T4 fourth, T5 fifth, T6 sixth) + { + return Combine(Combine(first, second, third, fourth, fifth), FromNullable(sixth)); + } + + public static int Combine(T1 first, T2 second, T3 third, T4 fourth, T5 fifth, T6 sixth, T7 seventh) + { + return Combine(Combine(first, second, third, fourth, fifth, sixth), FromNullable(seventh)); + } + + public static int Combine(T1 first, T2 second, T3 third, T4 fourth, T5 fifth, T6 sixth, T7 seventh, T8 eighth) + { + return Combine(Combine(first, second, third, fourth, fifth, sixth, seventh), FromNullable(eighth)); + } + } +} diff --git a/Assets/HoloToolkit/Utilities/Scripts/HashCodes.cs.meta b/Assets/HoloToolkit/Utilities/Scripts/HashCodes.cs.meta new file mode 100644 index 00000000000..c55dbd7ba1b --- /dev/null +++ b/Assets/HoloToolkit/Utilities/Scripts/HashCodes.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 26f09b5e3933ebe4d8bd44cbb08bdc11 +timeCreated: 1489008371 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Utilities/Scripts/ReadOnlyHashSet.cs b/Assets/HoloToolkit/Utilities/Scripts/ReadOnlyHashSet.cs new file mode 100644 index 00000000000..4142b69aaea --- /dev/null +++ b/Assets/HoloToolkit/Utilities/Scripts/ReadOnlyHashSet.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace HoloToolkit.Unity +{ + /// + /// A wrapper for that doesn't allow modification of the set. This is + /// useful for handing out references to a set that is going to be modified internally, without + /// giving external consumers the opportunity to accidentally modify the set. + /// + public class ReadOnlyHashSet : + ICollection, + IEnumerable, + IEnumerable + { + private readonly HashSet underlyingSet; + + public ReadOnlyHashSet(HashSet underlyingSet) + { + Debug.Assert(underlyingSet != null, "underlyingSet cannot be null."); + + this.underlyingSet = underlyingSet; + } + + public int Count + { + get { return underlyingSet.Count; } + } + + bool ICollection.IsReadOnly + { + get { return true; } + } + + void ICollection.Add(TElement item) + { + throw NewWriteDeniedException(); + } + + void ICollection.Clear() + { + throw NewWriteDeniedException(); + } + + public bool Contains(TElement item) + { + return underlyingSet.Contains(item); + } + + public void CopyTo(TElement[] array, int arrayIndex) + { + underlyingSet.CopyTo(array, arrayIndex); + } + + public IEnumerator GetEnumerator() + { + return underlyingSet.GetEnumerator(); + } + + bool ICollection.Remove(TElement item) + { + throw NewWriteDeniedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return underlyingSet.GetEnumerator(); + } + + private NotSupportedException NewWriteDeniedException() + { + return new NotSupportedException("ReadOnlyHashSet is not directly writeable."); + } + } + + public static class ReadOnlyHashSetRelatedExtensions + { + public static ReadOnlyHashSet AsReadOnly(this HashSet set) + { + return new ReadOnlyHashSet(set); + } + } +} diff --git a/Assets/HoloToolkit/Utilities/Scripts/ReadOnlyHashSet.cs.meta b/Assets/HoloToolkit/Utilities/Scripts/ReadOnlyHashSet.cs.meta new file mode 100644 index 00000000000..927d01e0667 --- /dev/null +++ b/Assets/HoloToolkit/Utilities/Scripts/ReadOnlyHashSet.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 56703d2c7694abe42976c2c71158fff7 +timeCreated: 1491183357 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Utilities/Scripts/StartAwareSingleton.cs b/Assets/HoloToolkit/Utilities/Scripts/StartAwareSingleton.cs new file mode 100644 index 00000000000..73fa8a7d1b1 --- /dev/null +++ b/Assets/HoloToolkit/Utilities/Scripts/StartAwareSingleton.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using UnityEngine; + +namespace HoloToolkit.Unity +{ + /// + /// A singleton designed to help child singletons take certain actions only after Start has been called. + /// + public abstract class StartAwareSingleton : Singleton + where T : StartAwareSingleton + { + #region MonoBehaviour implementation + + protected virtual void OnEnable() + { + if (IsStarted) + { + OnEnableAfterStart(); + } + } + + protected virtual void OnDisable() + { + if (IsStarted) + { + OnDisableAfterStart(); + } + } + + protected virtual void Start() + { + IsStarted = true; + OnEnableAfterStart(); + } + + #endregion + + protected bool IsStarted { get; private set; } + + /// + /// This method is similar to Unity's OnEnable method, except that it's called only after Start. This + /// means all classes will have had a chance to run their Awake methods and + /// will be safe to use. + /// + protected virtual void OnEnableAfterStart() + { + Debug.Assert(IsStarted, "OnEnableAfterStart should only occur after Start."); + } + + /// + /// This method is similar to Unity's OnDisable method, except that it's called only after Start. This + /// means all classes will have had a chance to run their Awake methods and + /// will be safe to use. + /// + protected virtual void OnDisableAfterStart() + { + Debug.Assert(IsStarted, "OnDisableAfterStart should only occur after Start."); + } + } +} diff --git a/Assets/HoloToolkit/Utilities/Scripts/StartAwareSingleton.cs.meta b/Assets/HoloToolkit/Utilities/Scripts/StartAwareSingleton.cs.meta new file mode 100644 index 00000000000..090c2a18d6c --- /dev/null +++ b/Assets/HoloToolkit/Utilities/Scripts/StartAwareSingleton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2023f3a5d9e1c94429bce9f77720ec71 +timeCreated: 1488483761 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HoloToolkit/Utilities/Tests/Scenes/StabilizationPlaneSetting.unity b/Assets/HoloToolkit/Utilities/Tests/Scenes/StabilizationPlaneSetting.unity index 21624e556bf..92a5142e6bf 100644 --- a/Assets/HoloToolkit/Utilities/Tests/Scenes/StabilizationPlaneSetting.unity +++ b/Assets/HoloToolkit/Utilities/Tests/Scenes/StabilizationPlaneSetting.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 8 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -25,6 +25,7 @@ RenderSettings: m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -37,11 +38,11 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37311995, g: 0.38074034, b: 0.35872716, a: 1} + m_IndirectSpecularColor: {r: 0.3731199, g: 0.38074028, b: 0.35872713, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 7 + serializedVersion: 9 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -53,7 +54,7 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 4 + serializedVersion: 8 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 @@ -66,13 +67,27 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_DirectLightInLightProbes: 1 m_FinalGather: 0 m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 m_LightingDataAsset: {fileID: 0} - m_RuntimeCPUUsage: 25 + m_ShadowMaskMode: 2 --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -89,6 +104,8 @@ NavMeshSettings: minRegionArea: 2 manualCellSize: 0 cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 accuratePlacement: 0 m_NavMeshData: {fileID: 0} --- !u!1 &25419862 stripped @@ -484,6 +501,7 @@ MeshRenderer: m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 + m_SortingLayer: 0 m_SortingOrder: 0 --- !u!1001 &664937489 Prefab: @@ -608,6 +626,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: SetStabilizationPlane: 1 + UseUnscaledTime: 1 LerpStabilizationPlanePowerCloser: 4 LerpStabilizationPlanePowerFarther: 7 targetOverride: {fileID: 0} @@ -946,6 +965,11 @@ Prefab: propertyPath: SearchForCursorIfUnset value: 0 objectReference: {fileID: 0} + - target: {fileID: 114742747811649402, guid: 3eddd1c29199313478dd3f912bfab2ab, + type: 2} + propertyPath: SearchForCursorIfUnset + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: - {fileID: 114000013868099214, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 3eddd1c29199313478dd3f912bfab2ab, type: 2}