Ejemplo n.º 1
0
    public void UpdateUnitFrame(HeroController hero)
    {
        int curHealth = hero.GetCurrentHealth();
        int maxHealth = hero.GetMaxHealth();

        healthBar.fillAmount = (float)curHealth / maxHealth;
        levelText.text       = hero.GetCurrentLevel().ToString();
    }
    public void UpdateUnitFrame(HeroController hero)
    {
        // Gather Data
        int currentHealth = hero.GetCurrentHealth();
        int maxHealth     = hero.GetMaxHealth();
        int currentLevel  = hero.GetCurrentLevel();

        // Perform Logik on thaz Data!
        float fillAmount = (float)currentHealth / (float)maxHealth;

        levelText.text       = currentLevel.ToString();
        healthbar.fillAmount = fillAmount;
    }