public void Deinitilize() { if (_timeObject != null) { _timeObject.OnTimeUpdateHandler -= TimeUpdate; _timeObject.OnForwardHandler -= OnForward; _timeObject.OnBackwardHandler -= OnBackward; _timeObject.OnPauseHandler -= OnPause; _timeObject = null; } }
public void Initilize() { if (_timeObject == null) { _timeObject = gameObject.GetComponent <TimeObjectComponent>(); _timeObject.OnTimeUpdateHandler += TimeUpdate; _timeObject.OnForwardHandler += OnForward; _timeObject.OnBackwardHandler += OnBackward; _timeObject.OnPauseHandler += OnPause; } }