Exemplo n.º 1
0
    public void ReceiveHealing(float healAmount)
    {
        if (playerHealth < maxHealth)
        {
            playerHealth += healAmount;

            // maybe we should re enable the player when above half health

            if (playerHealth >= maxHealth)
            {
                playerHealth = maxHealth;
                currentState = PlayerState.Normal;
                sfx.FullHealth();
                sfx.StoppingOverheat();
                Debug.Log("Went to maximum");
            }
        }

        uiController.UpdateHealth(playerHealth);
        animator.SetFloat("health", playerHealth);
    }