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"); } } }
public void Stop() { callback.Invoke(); TimerHandle.UnregisterTimer(this); }
public void Cancel() { TimerHandle.UnregisterTimer(this); }
public void Play() { elapsedTime = 0f; TimerHandle.RegisterTimer(this); }