Skip to content

Commit

Permalink
added some error checking
Browse files Browse the repository at this point in the history
  • Loading branch information
dooly123 committed Feb 8, 2025
1 parent 99a34ad commit 88ba139
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ public void Initialize(UnityEngine.XR.InputDevice device, string UniqueID, strin
public new void OnDestroy()
{
BasisVirtualSpine.DeInitialize();
BasisOpenXRInputEye.Shutdown();
if (BasisOpenXRInputEye != null)
{
BasisOpenXRInputEye.Shutdown();
}
base.OnDestroy();
}
public override void DoPollData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,21 @@ private void PollSystem()
InteractInput interactInput = InteractInputs[Index];
if (interactInput.input == null)
{
Debug.LogWarning("Pickup input device unexpectedly null, input devices likely changed");
BasisDebug.LogWarning("Pickup input device unexpectedly null, input devices likely changed");
continue;
}

HoverInteractSphere hoverSphere = interactInput.hoverInteract;

RaycastHit rayHit;
InteractableObject hitInteractable = null;

if(interactInput.input.BasisPointRaycaster == null)
{
BasisDebug.LogWarning("Missing Point Raycaster!");
continue;
}

bool isValidRayHit = interactInput.input.BasisPointRaycaster.FirstHit(out rayHit, raycastDistance) &&
((1 << rayHit.collider.gameObject.layer) & InteractableLayerMask) != 0 &&
rayHit.collider.TryGetComponent(out hitInteractable);
Expand Down

0 comments on commit 88ba139

Please sign in to comment.