Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (this.events != null)
     {
         for (int i = this.events.Count - 1; i >= 0; i--)
         {
             TimerEvent timerEvent = events [i];
             if (Time.time >= timerEvent.timeShouldFire)
             {
                 timerEvent.doAction();
                 if (!timerEvent.repeat)
                 {
                     this.events.Remove(timerEvent);
                 }
                 else
                 {
                     timerEvent.Renew();
                 }
             }
         }
     }
 }