Exemplo n.º 1
0
    public float DamageObj(float damage)
    {
        if (!Alive)
        {
            return(0f);
        }
        float healthBefore = Health;

        Health = Mathf.Max(Mathf.Min(MaxHealth, Health - damage), 0);
        Alive  = (Health > 0);
        float diff = Health - healthBefore;

        if (m_display != null)
        {
            m_display.ChangeValue(diff, Health);
        }
        return(diff);
    }
Exemplo n.º 2
0
 public void ChangeSentiment(int value)
 {
     CurrentSentiment += value;
     CurrentSentiment  = Mathf.Max(0, CurrentSentiment);
     m_display.ChangeValue(value, CurrentSentiment);
 }