Beispiel #1
0
    public int GetSectionHealth(int section)
    {
        RocketSectionHealth rsh = sections[section];

        if (rsh != null)
        {
            return(rsh.currentHealth);
        }
        return(-1);
    }
Beispiel #2
0
    public void SetSectionHealth(int section, int health)
    {
        RocketSectionHealth rsh = sections[section];

        if (rsh != null)
        {
            rsh.currentHealth            = health;
            sectionImages[section].color = healthGradient.Evaluate(((float)rsh.currentHealth) / rsh.maxHealth);
        }
    }
Beispiel #3
0
    public int RemoveSectionHealth(int section, int healthToRemove)
    {
        RocketSectionHealth rsh = sections[section];

        if (rsh != null)
        {
            rsh.currentHealth           -= healthToRemove;
            sectionImages[section].color = healthGradient.Evaluate(((float)rsh.currentHealth) / rsh.maxHealth);
            return(rsh.currentHealth);
        }

        return(-1);
    }
Beispiel #4
0
    public void ShowHealth(int section)
    {
        RocketSectionHealth rsh = sections[section];

        sectionImages[section].color = healthGradient.Evaluate(((float)rsh.currentHealth) / rsh.maxHealth);
    }