From 00e448afd9b6c77ceb4ebab9d2be00a85d0cb926 Mon Sep 17 00:00:00 2001 From: Lars Simkins Date: Fri, 10 Nov 2017 12:31:29 -0800 Subject: [PATCH] Pull request changes, round 4 --- .../Input/Scripts/Focus/IPointingSource.cs | 3 +++ .../Input/Scripts/Focus/InputSourcePointer.cs | 19 +++++++++++++------ .../Input/Scripts/Gaze/GazeManager.cs | 10 ++++++++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Assets/HoloToolkit/Input/Scripts/Focus/IPointingSource.cs b/Assets/HoloToolkit/Input/Scripts/Focus/IPointingSource.cs index 4ddd81ceec6..d771ea5ac16 100644 --- a/Assets/HoloToolkit/Input/Scripts/Focus/IPointingSource.cs +++ b/Assets/HoloToolkit/Input/Scripts/Focus/IPointingSource.cs @@ -25,6 +25,9 @@ public interface IPointingSource PointerResult Result { get; set; } + [Obsolete("Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")] + void UpdatePointer(); + void OnPreRaycast(); void OnPostRaycast(); diff --git a/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs b/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs index 5b96240e18b..df821823625 100644 --- a/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs +++ b/Assets/HoloToolkit/Input/Scripts/Focus/InputSourcePointer.cs @@ -24,7 +24,8 @@ public class InputSourcePointer : IPointingSource [Obsolete("Will be removed in a later version. Use Rays instead.")] public Ray Ray { get { return Rays[0]; } } - public RayStep[] Rays { + public RayStep[] Rays + { get { return rays; @@ -46,8 +47,14 @@ public bool InteractionEnabled } private RayStep[] rays = new RayStep[1] { new RayStep(Vector3.zero, Vector3.forward) }; - - public void OnPreRaycast() + + [Obsolete("Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")] + public void UpdatePointer() + { + + } + + public virtual void OnPreRaycast() { if (InputSource == null) { @@ -60,7 +67,7 @@ public void OnPreRaycast() Ray pointingRay = default(Ray); if (InputSource.TryGetPointingRay(InputSourceId, out pointingRay)) { - rays[0].CopyRay(pointingRay, FocusManager.Instance.GetPointingExtent (this)); + rays[0].CopyRay(pointingRay, FocusManager.Instance.GetPointingExtent(this)); } } @@ -71,7 +78,7 @@ public void OnPreRaycast() } } - public void OnPostRaycast() + public virtual void OnPostRaycast() { // Nothing needed } @@ -88,6 +95,6 @@ public bool InputIsFromSource(BaseEventData eventData) return (inputData != null) && (inputData.InputSource == InputSource) && (inputData.SourceId == InputSourceId); - } + } } } diff --git a/Assets/HoloToolkit/Input/Scripts/Gaze/GazeManager.cs b/Assets/HoloToolkit/Input/Scripts/Gaze/GazeManager.cs index 3b0b955ea87..8fd996ed20f 100644 --- a/Assets/HoloToolkit/Input/Scripts/Gaze/GazeManager.cs +++ b/Assets/HoloToolkit/Input/Scripts/Gaze/GazeManager.cs @@ -209,12 +209,18 @@ private void UpdateGazeInfo() UpdateHitPosition(); } - public void OnPreRaycast() + [Obsolete("Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")] + public void UpdatePointer() + { + + } + + public virtual void OnPreRaycast() { UpdateGazeInfo(); } - public void OnPostRaycast() + public virtual void OnPostRaycast() { // Nothing needed }