public void Update(ViveRoleProperty role) { UpdateFieldString <ControllerButton>(ref buttonPressedFields, ViveInput.GetPress(role), buttonPressed); foreach (ControllerAxis i in axisValue.Enums) { axisValue[i] = ViveInput.GetAxis(role, i); } }
private void UpdateState() { if (!ChangeProp.Set(ref m_updatedFrameCount, Time.frameCount)) { return; } m_prevPressState = m_currPressState; m_currPressState = false; if (m_inputs.Count == 0) { return; } switch (m_combineInputsOperator) { case InputsOperatorEnum.Or: m_currPressState = false; for (int i = 0, imax = m_inputs.Count; i < imax; ++i) { if (ViveInput.GetPress(m_inputs[i].viveRole, m_inputs[i].button)) { m_currPressState = true; break; } } break; case InputsOperatorEnum.And: m_currPressState = true; for (int i = 0, imax = m_inputs.Count; i < imax; ++i) { if (!ViveInput.GetPress(m_inputs[i].viveRole, m_inputs[i].button)) { m_currPressState = false; break; } } break; } }
public override bool GetPress() { return(ViveInput.GetPress(hand, viveButton)); }