示例#1
0
    public void AddHealthFromPotion(GameObject potion)
    {
        Destroy(potion);

        // Deal with health
        HealthPotion healthPotion = potion.GetComponent <HealthPotion>();

        currentHealth     += healthPotion.GetHealthRecovery();
        currentHealth      = Mathf.Min(startingHealth, currentHealth);
        healthSlider.value = currentHealth;

        StartCoroutine(FlashGreen());
    }