Beispiel #1
0
    public void UpdateXPBar(Player.PlayerStats playerStats)
    {
        int xpIntoLevel = playerStats.xp.Amount - GetXPForLevel(playerStats.level.Amount - 1);
        int xpForNext   = GetXPForLevel(playerStats.level.Amount) - GetXPForLevel(playerStats.level.Amount - 1);

        Debug.Log(xpIntoLevel + "/" + xpForNext);
        m_xpBar.ChangeSliderValue(xpIntoLevel, xpForNext);
    }
Beispiel #2
0
    public void Setup(StatInfo statInfo, Stat stat)
    {
        if (statInfo.Icon != null)
        {
            m_image.sprite = statInfo.Icon;
        }
        else
        {
            m_image.color = statInfo.Colour;
        }

        m_name.text = statInfo.ShortName;

        m_progressBar.SetAlwaysMax(stat.AlwaysMax);
        m_progressBar.ChangeSliderValue(stat.CurrentStat, stat.MaxStat);
        m_progressBar.SetProgressBarColour(statInfo.Colour);
    }