コード例 #1
0
 private static void EnsureSurrogate()
 {
     if (!_surrogate)
     {
         _surrogate = ComponentUtility.Create<EmptyMonoBehaviour>("CoroutineUtilitySurrogate");
         _surrogate.hideFlags = HideFlags.NotEditable;
         Object.DontDestroyOnLoad(_surrogate);
     }
 }
コード例 #2
0
 public static void CleanUp()
 {
     if (_referenceEmptyGameObject != null)
     {
         GameObject.Destroy(_referenceEmptyGameObject);
     }
     if (_coroutineRunner != null)
     {
         _coroutineRunner = null;
     }
 }
コード例 #3
0
 private static void EnsureSurrogate()
 {
     if (!_surrogate)
     {
         _surrogate =
             ComponentUtility.Create <EmptyMonoBehaviour>(
                 "CoroutineUtilitySurrogate");
         _surrogate.hideFlags = HideFlags.NotEditable;
         Object.DontDestroyOnLoad(_surrogate);
     }
 }
コード例 #4
0
 public static void StartUniqueCoroutine(IEnumerator routine)
 {
     CleanUp();
     _coroutineRunner = InitCoroutineRunner();
     _coroutineRunner.StartCoroutine(routine);
 }