EVERYTHING
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR;
|
||||
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class SecondaryInputBehavior : NodeBehavior
|
||||
{
|
||||
private const float GripThreshold = 0.7f;
|
||||
|
||||
private const float TriggerThreshold = 0.7f;
|
||||
|
||||
public override void OnGraphUpdate()
|
||||
{
|
||||
bool flag = Input.GetMouseButton(1);
|
||||
InputDevice deviceAtXRNode = InputDevices.GetDeviceAtXRNode(XRNode.LeftHand);
|
||||
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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user