Ejemplo n.º 1
0
 // -------------------------------------------------------------------------
 private void Update()
 {
     // If our time is running...
     if (timerRunning == true)
     {
         // The timer is running, we should change our time value
         // Are we counting up?
         if (countMode == CountMode.COUNT_UP)
         {
             // We're counting up, so add to our time value
             // We add Time.deltaTime, the amount of time passed since
             timerData.ActionAddValue(Time.deltaTime);
         }
         // Or, are we counting down?
         else if (countMode == CountMode.COUNT_DOWN)
         {
             // We're counting down, so subtract from our time value
             // We subtract Time.deltaTime, the amount of time passed since
             // (Adding a negative value is the same as subtracting it)
             timerData.ActionAddValue(-Time.deltaTime);
         }
     }
 }