Beispiel #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (Active)
     {
         CurrentTime += Time.deltaTime;
         CurrentTimeUpdated?.Invoke(this, CurrentTime);
         if (CurrentTime >= timeInterval)
         {
             if (!SingleUse)
             {
                 OnTick?.Invoke(this, CurrentTime);
                 CurrentTime = 0f;
             }
             else
             {
                 OnTick?.Invoke(this, CurrentTime);
                 Active = false;
             }
         }
     }
 }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 public virtual void Update()
 {
     CurrentTimeUpdated?.Invoke(this, EventArgs.Empty);
 }