// called by the VRGestureRig when created public void InitRig(VRGestureRig _rig, Handedness _handType) { rig = _rig; handType = _handType; input = rig.GetInput(handType); selectButton = rig.menuButton; }
public bool GetButtonUp(InputOptions.Button button) { if (button == InputOptions.Button.Trigger1) { return(trigger1ButtonUp); } if (button == InputOptions.Button.Trigger2) { return(trigger2ButtonUp); } return(false); }
//Shared functionality VRController. public bool GetButtonDown(InputOptions.Button button) { if (button == InputOptions.Button.Button1) { return(button1Down); } if (button == InputOptions.Button.Button2) { return(button2Down); } if (button == InputOptions.Button.Thumbstick) { return(directional1ButtonDown); } if (button == InputOptions.Button.Trigger1) { return(trigger1ButtonDown); } if (button == InputOptions.Button.Trigger2) { return(trigger2ButtonDown); } return(false); }
//This is shared between both Steam and Oculus, this could be put into VRController. //Also this should be a dictionary instead of a monster if statement. public bool GetButton(InputOptions.Button button) { if (button == InputOptions.Button.Button1) { return(button1); } if (button == InputOptions.Button.Button2) { return(button2); } if (button == InputOptions.Button.Directional1) { return(directional1Button); } if (button == InputOptions.Button.Trigger1) { return(trigger1Button); } if (button == InputOptions.Button.Trigger2) { return(trigger2Button); } return(false); }