private static InputButtonStates GetDesktopButtonState(string _buttonID) { InputButton button = RetrieveButtonByID(_buttonID); InputButtonStates buttonState = InputButtonStates.Off; if (button != null) { if (Input.GetButtonDown(_buttonID)) { Debug.LogError("_buttonID: " + _buttonID + "Down"); buttonState = InputButtonStates.Down; } else if (Input.GetButton(_buttonID)) { buttonState = InputButtonStates.Pressed; Debug.LogError("_buttonID: " + _buttonID + "Pressed"); } else if (Input.GetButtonUp(_buttonID)) { Debug.LogError("_buttonID: " + _buttonID + "Up"); buttonState = InputButtonStates.Up; } } return(buttonState); }
public static void InteractWithButton(string _buttonID, InputButtonStates _newbuttonState) { InputButton button = RetrieveButtonByID(_buttonID); if (button != null) { button.ChangeButtonState(_newbuttonState); } return; }
public static InputButtonStates GetButtonState(string _buttonID) { InputButtonStates buttonState = InputButtonStates.Off; if (IsOnMobile) { buttonState = GetVirtualButtonState(_buttonID); } else { buttonState = GetDesktopButtonState(_buttonID); } return(buttonState); }
private bool CheckGripButton(InputButtonStates state) { if (NodeType == XRNode.LeftHand) { return(ModuleInput.Instance.GetSelectionMethodRift().AuxiliarGripButton(state)); } else if (NodeType == XRNode.RightHand) { return(ModuleInput.Instance.GetSelectionMethodRift().MainGripButton(state)); } else { Debug.Log("XRNode type mus be a Hand! Current type is" + NodeType.ToString()); } return(false); }
public bool CheckTriggerButton(InputButtonStates state) { if (NodeType == XRNode.LeftHand) { return(Input.GetButton(InputStatics.Auxiliar_Trigger)); } else if (NodeType == XRNode.RightHand) { return(Input.GetButton(InputStatics.Main_Trigger)); } else { Debug.Log("XRNode type mus be a Hand! Current type is" + NodeType.ToString()); } return(false); }
public override bool AuxiliarGripButton(InputButtonStates state) { bool ret = false; switch (state) { case InputButtonStates.UP: ret = (Input.GetAxis(InputStatics.Auxiliar_Grip) < 0.2f); break; case InputButtonStates.DOWN: if (Input.GetAxis(InputStatics.Auxiliar_Grip) != 0) { if (!m_auxGripAxisInUse) { m_auxAxisInUse = true; ret = true; } } if (Input.GetAxisRaw(InputStatics.Auxiliar_Grip) == 0) { m_auxGripAxisInUse = false; } break; case InputButtonStates.PRESS: ret = (Input.GetAxisRaw(InputStatics.Auxiliar_Grip) != 0); break; case InputButtonStates.NONE: break; } return(ret); }
public override bool AuxiliarTiggerButton(InputButtonStates state) { bool ret = false; switch (state) { case InputButtonStates.UP: ret = (Input.GetButtonUp(InputStatics.Auxiliar_Trigger)); break; case InputButtonStates.DOWN: ret = (Input.GetButtonDown(InputStatics.Auxiliar_Trigger)); break; case InputButtonStates.PRESS: ret = (Input.GetButton(InputStatics.Auxiliar_Trigger)); break; case InputButtonStates.NONE: break; } return(ret); }
public override bool MainGripButton(InputButtonStates state) { bool ret = false; switch (state) { case InputButtonStates.UP: ret = (Input.GetButtonUp(InputStatics.Main_Grip)); break; case InputButtonStates.DOWN: ret = (Input.GetButtonDown(InputStatics.Main_Grip)); break; case InputButtonStates.PRESS: ret = (Input.GetButton(InputStatics.Main_Grip)); break; case InputButtonStates.NONE: break; } return(ret); }
public override bool MainTiggerButton(InputButtonStates state) { bool ret = false; switch (state) { case InputButtonStates.UP: ret = (Input.GetAxis(InputStatics.Main_Trigger_Rift) < 0.2f); break; case InputButtonStates.DOWN: if (Input.GetAxis(InputStatics.Main_Trigger_Rift) != 0) { if (!m_mainAxisInUse) { m_mainAxisInUse = true; ret = true; } } if (Input.GetAxisRaw(InputStatics.Main_Trigger_Rift) == 0) { m_mainAxisInUse = false; } break; case InputButtonStates.PRESS: ret = (Input.GetAxisRaw(InputStatics.Main_Trigger_Rift) != 0); break; case InputButtonStates.NONE: break; } return(ret); }
public bool GetMainTriggerButton(InputButtonStates state) { return(m_deviceInput.MainTiggerButton(state)); }
public abstract bool AuxiliarGripButton(InputButtonStates state);
public abstract bool AuxiliarTiggerButton(InputButtonStates state);
public abstract bool MainGripButton(InputButtonStates state);
public abstract bool MainTiggerButton(InputButtonStates state);
public override bool MainGripButton(InputButtonStates state) { return(false); }
public bool GetAuxiliarTriggerButton(InputButtonStates state) { return(m_deviceInput.AuxiliarTiggerButton(state)); }
public override bool AuxiliarGripButton(InputButtonStates state) { return(false); }
public void ChangeButtonState(InputButtonStates _newState) { CurrentState = _newState; return; }