using UnityEngine; using UnityEngine.XR; [DisallowMultipleComponent] public sealed class PrimaryInputBehavior : NodeBehavior { private const float GripThreshold = 0.7f; private const float TriggerThreshold = 0.7f; public override void OnGraphUpdate() { bool flag = Input.GetMouseButton(0); InputDevice deviceAtXRNode = InputDevices.GetDeviceAtXRNode(XRNode.RightHand); if (deviceAtXRNode.isValid) { float value; bool value2; bool flag2 = (deviceAtXRNode.TryGetFeatureValue(CommonUsages.grip, out value) && value >= 0.7f) || (deviceAtXRNode.TryGetFeatureValue(CommonUsages.gripButton, out value2) && value2); float value3; bool flag3 = deviceAtXRNode.TryGetFeatureValue(CommonUsages.trigger, out value3) && value3 >= 0.7f; flag = flag || (flag2 && flag3); } SetLocalOutputValueIfChanged("Held", BSValue.FromBool(flag)); } }