Esempio n. 1
0
    public IEnumerator UpdateEnergy()
    {
        if (m_pMonster.EnergyChanged)
        {
            yield return(energySliderBar.SetValueSmooth((float)m_pMonster.CurrentEnergy / m_pMonster.MaxEnergy,
                                                        (currentValue) => { energyText.text = Mathf.FloorToInt(m_pMonster.MaxEnergy * currentValue) + "/" + m_pMonster.MaxEnergy; }));

            m_pMonster.EnergyChanged = false;
        }
    }
Esempio n. 2
0
    public IEnumerator UpdateHealth()
    {
        if (m_pMonster.HealthChanged)
        {
            yield return(healthSliderBar.SetValueSmooth((float)m_pMonster.CurrentHealth / m_pMonster.MaxHealth,
                                                        (currentValue) => { healthText.text = Mathf.FloorToInt(m_pMonster.MaxHealth * currentValue) + "/" + m_pMonster.MaxHealth; }));

            m_pMonster.HealthChanged = false;
        }
    }