private void MovementInput() { float input = Input.GetAxis("Horizontal"); if (input > 0) { input = 1; } else if (input < 0) { input = -1; } movementManager.MovementInput = input; if (Input.GetButtonDown("Dash")) { movementManager.DashPressed(); } if (Input.GetButtonUp("Dash")) { movementManager.DashReleased(); } }
public void ReceiveDamage(int damage, Transform sourceOfDamage) { if (playerState == EPlayerState.Executing) { return; } Health -= damage; if (Health <= 0) { Respawn(); return; } movementManager.DashReleased(); meleeManager.EndAttack(); EDirection directionOfContact = sourceOfDamage.position.x >= transform.position.x ? EDirection.DownRight : EDirection.DownLeft; movementManager.KickBack(directionOfContact); StartCoroutine(DamageFlash()); }