예제 #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);
 }