示例#1
0
 public void DecreaseStat(LifeStat stat)
 {
     statLookup[stat]--;
     scoreSlider        = GameObject.FindWithTag(stat.ToString()).GetComponent <Slider>();
     scoreSlider.value -= 1;
     if (statLookup[stat] < 0)
     {
         Debug.LogWarning("Stat is at minimum: " + stat.ToString());
         statLookup[stat] = 0;
     }
     else
     {
         Debug.Log($"{stat.ToString()} stat decreased to {statLookup[stat]}");
     }
 }
示例#2
0
 public void IncreaseStat(LifeStat stat)
 {
     statLookup[stat]++;
     scoreSlider        = GameObject.FindWithTag(stat.ToString()).GetComponent <Slider>();
     scoreSlider.value += 1;
     if (statLookup[stat] > MAX_STAT_LEVEL)
     {
         Debug.LogWarning("Stat is at max: " + stat.ToString());
         statLookup[stat] = MAX_STAT_LEVEL;
     }
     else
     {
         Debug.Log($"{stat.ToString()} stat increased to {statLookup[stat]}");
     }
 }