Skip to content

Instantly share code, notes, and snippets.

@julenka
Created January 8, 2020 20:45
Show Gist options
  • Save julenka/045197f9168e1c4774e45e8f1be3aaf3 to your computer and use it in GitHub Desktop.
Save julenka/045197f9168e1c4774e45e8f1be3aaf3 to your computer and use it in GitHub Desktop.
Check if any hand is pinching or pressed in MRTK
private bool IsAnyHandPressed()
{
foreach (var controller in CoreServices.InputSystem.DetectedControllers)
{
if (controller is IMixedRealityHand)
{
for (int i = 0; i < controller.Interactions.Length; i++)
{
if(controller.Interactions[i].InputType == DeviceInputType.Select)
{
return controller.Interactions[i].BoolData;
}
}
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment