8 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 22 public uint InputSourceId {
get;
set; }
26 public bool OwnAllInput {
get;
set; }
28 [Obsolete(
"Will be removed in a later version. Use Rays instead.")]
29 public Ray Ray {
get {
return Rays[0]; } }
41 public float? ExtentOverride {
get;
set; }
43 public LayerMask[] PrioritizedLayerMasksOverride {
get;
set; }
45 public bool InteractionEnabled
53 public bool FocusLocked {
get;
set; }
59 private bool selectPressed =
false;
61 [Obsolete(
"Will be removed in a later version. Use OnPreRaycast / OnPostRaycast instead.")]
68 if (InputSource == null)
74 Debug.Assert(InputSource.SupportsInputInfo(InputSourceId,
SupportedInputInfo.Pointing),
string.Format(
"{0} with id {1} does not support pointing!", InputSource, InputSourceId));
76 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 79 InteractionSourceState[] currentReading = InteractionManager.GetCurrentReading();
80 for (
int i = 0; i < currentReading.Length; i++)
82 InteractionSourceState sourceState = currentReading[i];
84 if (sourceState.source.id != InputSourceId)
89 selectPressed = sourceState.selectPressed;
94 if (!sourceState.sourcePose.TryGetPosition(out position, InteractionSourceNode.Pointer))
99 if (!sourceState.sourcePose.TryGetForward(out forward, InteractionSourceNode.Pointer))
107 forward =
CameraCache.
Main.transform.parent.TransformDirection(forward);
114 if (InputSource.TryGetPointingRay(InputSourceId, out pointingRay))
121 if (RayStabilizer != null)
123 RayStabilizer.UpdateStability(rays[0].
Origin, rays[0].Direction);
130 if (PointerRay != null)
132 PointerRay.UpdateRenderedLine(rays, Result, selectPressed,
FocusManager.
Instance.GetPointingExtent(
this));
138 return (OwnAllInput || InputIsFromSource(eventData));
145 return (inputData != null)
146 && (inputData.InputSource == InputSource)
147 && (inputData.SourceId == InputSourceId);