|
2 | 2 | // Licensed under the MIT License.
|
3 | 3 |
|
4 | 4 | using Microsoft.MixedReality.Toolkit.Physics;
|
| 5 | +using System; |
5 | 6 | using System.Collections;
|
6 | 7 | using Unity.Profiling;
|
7 | 8 | using UnityEngine;
|
@@ -233,7 +234,6 @@ public override IMixedRealityController Controller
|
233 | 234 | basePointerName = gameObject.name;
|
234 | 235 | }
|
235 | 236 | PointerName = $"{Handedness}_{basePointerName}";
|
236 |
| - InputSourceParent = base.Controller.InputSource; |
237 | 237 | SetCursor();
|
238 | 238 | }
|
239 | 239 | }
|
@@ -273,7 +273,15 @@ public string PointerName
|
273 | 273 | }
|
274 | 274 |
|
275 | 275 | /// <inheritdoc />
|
276 |
| - public IMixedRealityInputSource InputSourceParent { get; protected set; } |
| 276 | + public IMixedRealityInputSource InputSourceParent |
| 277 | + { |
| 278 | + get { return base.Controller?.InputSource; } |
| 279 | + |
| 280 | +#if UNITY_2020_3_OR_NEWER |
| 281 | + [Obsolete("Setting the Input Source Parent directly is no longer supported")] |
| 282 | +#endif |
| 283 | + protected set { Debug.LogWarning("Setting the Input Source Parent directly is no longer supported"); } |
| 284 | + } |
277 | 285 |
|
278 | 286 | /// <inheritdoc />
|
279 | 287 | public IMixedRealityCursor BaseCursor { get; set; }
|
@@ -500,9 +508,9 @@ public virtual void Reset()
|
500 | 508 | IsFocusLocked = false;
|
501 | 509 | }
|
502 | 510 |
|
503 |
| - #endregion IMixedRealityPointer Implementation |
| 511 | +#endregion IMixedRealityPointer Implementation |
504 | 512 |
|
505 |
| - #region IEquality Implementation |
| 513 | +#region IEquality Implementation |
506 | 514 |
|
507 | 515 | private static bool Equals(IMixedRealityPointer left, IMixedRealityPointer right)
|
508 | 516 | {
|
@@ -548,9 +556,9 @@ public override int GetHashCode()
|
548 | 556 | }
|
549 | 557 | }
|
550 | 558 |
|
551 |
| - #endregion IEquality Implementation |
| 559 | +#endregion IEquality Implementation |
552 | 560 |
|
553 |
| - #region IMixedRealitySourcePoseHandler Implementation |
| 561 | +#region IMixedRealitySourcePoseHandler Implementation |
554 | 562 |
|
555 | 563 | private static readonly ProfilerMarker OnSourceLostPerfMarker = new ProfilerMarker("[MRTK] BaseControllerPointer.OnSourceLost");
|
556 | 564 |
|
@@ -584,9 +592,9 @@ public override void OnSourceLost(SourceStateEventData eventData)
|
584 | 592 | }
|
585 | 593 | }
|
586 | 594 |
|
587 |
| - #endregion IMixedRealitySourcePoseHandler Implementation |
| 595 | +#endregion IMixedRealitySourcePoseHandler Implementation |
588 | 596 |
|
589 |
| - #region IMixedRealityInputHandler Implementation |
| 597 | +#region IMixedRealityInputHandler Implementation |
590 | 598 |
|
591 | 599 | private static readonly ProfilerMarker OnInputUpPerfMarker = new ProfilerMarker("[MRTK] BaseControllerPointer.OnInputUp");
|
592 | 600 |
|
@@ -671,6 +679,6 @@ public override void OnInputDown(InputEventData eventData)
|
671 | 679 | }
|
672 | 680 | }
|
673 | 681 |
|
674 |
| - #endregion IMixedRealityInputHandler Implementation |
| 682 | +#endregion IMixedRealityInputHandler Implementation |
675 | 683 | }
|
676 | 684 | }
|
0 commit comments