Esempio n. 1
0
    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();
        }
    }
Esempio n. 2
0
    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());
    }