Example #1
0
 internal void TickStats(float currentTime)
 {
     for (int i = 0; i < stats.Length; i++)
     {
         if (stats[i].ValueChangePerSecond != 0)
         {
             StatsHandler.Tick(stats[i], currentTime);
         }
     }
 }
Example #2
0
    public void HookUp(Stat statToDisplay)
    {
        if (DisplayedStat != null)
        {
            DisplayedStat.OnValueChanged -= SetFiller;
        }
        DisplayedStat = statToDisplay;
        SetFiller(StatsHandler.Tick(DisplayedStat, Time.deltaTime));
        NameText.text = statToDisplay.Name;
        if (statToDisplay.ValueChangePerSecond != 0)
        {
            isChanging = true;
        }

        SetTreshholdPosition(DisplayedStat.Threshhold);


        statToDisplay.OnThreshholdSet += SetTreshholdPosition;
        statToDisplay.OnValueChanged  += SetFiller;
    }