Example #1
0
    public void TakeDamage(LaserPowers power)
    {
        if (healthDeclineRatesDict.ContainsKey(power))
        {
            float amount = healthDeclineRatesDict[power];
            health -= amount;
            healthBar.fillAmount = health / 100;

            /* Maybe we can add a death animation  here */
            if (health <= 0)
            {
                Destroy(this.gameObject);
            }
        }
    }
Example #2
0
    public Color GetAssociatedColor(LaserPowers power)
    {
        Color c = powerColourPairingDict[power];

        return(new Color(c.r, c.g, c.b, c.a));
    }