private Vector2 GetRawMoveVector() { Vector2 move = Vector2.zero; move.x = InputController.GetAxis(horizontalCode); move.y = InputController.GetAxis(verticalCode); if (InputController.GetAxisDown(horizontalCode)) { if (move.x < 0) { move.x = -1f; } if (move.x > 0) { move.x = 1f; } } if (InputController.GetAxisDown(verticalCode)) { 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 |= InputController.GetKeyDown(submitCode); shouldActivate |= InputController.GetKeyDown(cancelCode); shouldActivate |= !Mathf.Approximately(InputController.GetAxis(horizontalCode), 0.0f); shouldActivate |= !Mathf.Approximately(InputController.GetAxis(verticalCode), 0.0f); shouldActivate |= (m_MousePosition - m_LastMousePosition).sqrMagnitude > 0.0f; shouldActivate |= input.GetMouseButtonDown(0); if (input.touchCount > 0) { shouldActivate = true; } return(shouldActivate); }