private static void EnsureSurrogate() { if (!_surrogate) { _surrogate = ComponentUtility.Create<EmptyMonoBehaviour>("CoroutineUtilitySurrogate"); _surrogate.hideFlags = HideFlags.NotEditable; Object.DontDestroyOnLoad(_surrogate); } }
public static void CleanUp() { if (_referenceEmptyGameObject != null) { GameObject.Destroy(_referenceEmptyGameObject); } if (_coroutineRunner != null) { _coroutineRunner = null; } }
private static void EnsureSurrogate() { if (!_surrogate) { _surrogate = ComponentUtility.Create <EmptyMonoBehaviour>( "CoroutineUtilitySurrogate"); _surrogate.hideFlags = HideFlags.NotEditable; Object.DontDestroyOnLoad(_surrogate); } }
public static void StartUniqueCoroutine(IEnumerator routine) { CleanUp(); _coroutineRunner = InitCoroutineRunner(); _coroutineRunner.StartCoroutine(routine); }