private Vector2 GetRawMoveVector() { Vector2 move = Vector2.zero; move.x = MyInput.GetAxisRaw(m_HorizontalAxis); move.y = MyInput.GetAxisRaw(m_VerticalAxis); if (MyInput.GetButtonDown(m_HorizontalAxis)) { if (move.x < 0) { move.x = -1f; } if (move.x > 0) { move.x = 1f; } } if (MyInput.GetButtonDown(m_VerticalAxis)) { if (move.y < 0) { move.y = -1f; } if (move.y > 0) { move.y = 1f; } } return(move); }
public override bool ShouldActivateModule() { if (!base.ShouldActivateModule()) { return(false); } var shouldActivate = m_ForceModuleActive; shouldActivate |= MyInput.GetButtonDown(m_SubmitButton); shouldActivate |= MyInput.GetButtonDown(m_CancelButton); shouldActivate |= !Mathf.Approximately(MyInput.GetAxisRaw(m_HorizontalAxis), 0.0f); shouldActivate |= !Mathf.Approximately(MyInput.GetAxisRaw(m_VerticalAxis), 0.0f); shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f; shouldActivate |= MyInput.GetMouseButtonDown(0); if (MyInput.touchCount > 0) { shouldActivate = true; } return(shouldActivate); }