Exemple #1
0
    void SetHealthBar()
    {
        //Opted for this instead of passing int into the event as a parameter.
        //This is because if we give the event a value, it will change the health
        //bar for all of the characters by that same amount. That is not what we want.
        float health    = _bc.GetHealth();
        float maxHealth = _bc.GetMaxHealth();
        float newSize   = health / maxHealth;

        StartCoroutine(LerpHealthBar(newSize));
    }
Exemple #2
0
    void SetStatBars()
    {
        //Opted for this instead of passing int into the event as a parameter.
        //This is because if we give the event a value, it will change the health
        //bar for all of the characters by the same amount. That is not what we want.
        float healthSize  = bc.GetHealth() * 0.01f;
        float staminaSize = bc.GetStamina() * 0.01f;

        StartCoroutine(LerpStatBars(healthSize, healthBar));
        //Dosen't work yet. Has weird effect on health bar lerp
        //StartCoroutine(LerpStatBars(staminaSize, staminaBar));
    }