Пример #1
0
 private void OnEnable()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         if (instance != this)
         {
             Destroy(gameObject);
             Debug.LogError("Only one Timer Handle can be created");
         }
     }
 }
Пример #2
0
 public void Stop()
 {
     callback.Invoke();
     TimerHandle.UnregisterTimer(this);
 }
Пример #3
0
 public void Cancel()
 {
     TimerHandle.UnregisterTimer(this);
 }
Пример #4
0
 public void Play()
 {
     elapsedTime = 0f;
     TimerHandle.RegisterTimer(this);
 }