private void Update() { InputDirectionStorage.StoreLastNonZeroDirection(CrossPlatformInputManager.GetAxisRaw("Horizontal")); OnMovementButtonPressed?.Invoke(InputDirectionStorage.CurrentDirection); if (CrossPlatformInputManager.GetButtonDown("Jump")) { OnJumpButtonPressed?.Invoke(); } if (CrossPlatformInputManager.GetButtonDown("Shift")) { OnDashButtonPressed?.Invoke(InputDirectionStorage.LastNonZeroDirection); } }
private void Update() { if (!GameEventsHandler.Instance.IsPlayerAlive) { return; } var horizontalInput = CrossPlatformInputManager.GetAxisRaw("Horizontal"); OnMovementButtonPressed?.Invoke(horizontalInput); if (CrossPlatformInputManager.GetButtonDown("B_Button")) { OnJumpButtonPressed?.Invoke(); } if (CrossPlatformInputManager.GetButtonDown("A_Button")) { OnAttackButtonPressed?.Invoke(); } }