Пример #1
0
 private void OnTouchUp()
 {
     if (!StressManager.GetBurnout())
     {
         if (StressManager.GetResting())
         {
             StressManager.SetResting(false);
             Debug.Log(StressManager.GetResting().ToString());
         }
         else // Not Resting
         {
             StressManager.SetResting(true);
             Debug.Log(StressManager.GetResting().ToString());
         }
     }
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (!StressManager.GetResting() && !StressManager.GetBurnout())
     {
         if (StressManager.GetStressLevel() < maxStress)
         {
             StressManager.IncreaseStressLevel(Time.deltaTime);
             stressBar.fillAmount = StressManager.GetStressLevel() / maxStress;
         }
         else
         {
             Debug.Log("BURNOUT");
             StressManager.SetBurnout(true);
             Debug.Log(StressManager.GetBurnout().ToString());
         }
     }
     else
     {
         if (StressManager.GetResting())
         {
             if (StressManager.GetStressLevel() > 0)
             {
                 StressManager.DecreaseStressLevel(Time.deltaTime * restRecoverySpeed);
                 stressBar.fillAmount = StressManager.GetStressLevel() / maxStress;
             }
             else
             {
                 StressManager.SetResting(false);
             }
         }
         else if (StressManager.GetBurnout())
         {
             if (StressManager.GetStressLevel() > 0)
             {
                 StressManager.DecreaseStressLevel(Time.deltaTime * burnoutRecoverySpeed);
                 stressBar.fillAmount = StressManager.GetStressLevel() / maxStress;
             }
             else
             {
                 StressManager.SetBurnout(false);
             }
         }
     }
 }