// Summary: // Provides movement vectors based on 2-Dimensional keyboard movement normalised before processing. // Movement vectors provided are the net directions relative to a fixed center. private void OnMovement(InputValue value) { if (pauseChecker.CheckIsPaused()) { return; } playerMovement.SetTriggerIsHeld(value.Get <Vector2>() != Vector2.zero); currentMousePosition = value.Get <Vector2>(); playerMovement.CalculateMovement(centerPosition, currentMousePosition); }
private void PerformJoystickActions(UnityEngine.InputSystem.EnhancedTouch.Touch touch) { if (touch.phase == UnityEngine.InputSystem.TouchPhase.Began) { joystick.RevealPad(startTouchPosition); } if (touch.phase == UnityEngine.InputSystem.TouchPhase.Moved) { joystick.TransformNavStick(touchPosition); } if (touch.phase == UnityEngine.InputSystem.TouchPhase.Ended) { joystick.HidePad(); isJoystickActive = false; } playerMovement.CalculateMovement(startTouchPosition, touchPosition); }