Esempio n. 1
0
 public void StopCoroutine(IEnumerator routine)
 {
     if (routine == null)
     {
         return;
     }
     _coroutineRunner.StopCoroutine(routine);
 }
Esempio n. 2
0
    public void End()
    {
        if (runner != null && timeInRoutine != null)
        {
            runner.StopCoroutine(timeInRoutine);
        }

        IsPlayingNormal.Value = false;
        isStopped             = true;
        isReversing           = false;
        hasEnded  = true;
        gameSpeed = 0;
    }
        public void OnDestroy()
        {
            destroyed = true;

            for (int i = 0; i < coroutineInstances.Count; i++)
            {
                CoroutineRunner corunner = (CoroutineRunner)coroutineInstances[i];
                corunner.StopCoroutine((Coroutine)loopRoutines[i]);
            }

            isRunning = false;
        }
Esempio n. 4
0
        private static void StopGlobalCustomMessageQueue(bool clearQueue = false)
        {
            if (_globalCustomMessageQueueRoutine != null)
            {
                CoroutineRunner.StopCoroutine(_globalCustomMessageQueueRoutine);
                _globalCustomMessageQueueRoutine = null;
            }

            if (clearQueue)
            {
                _globalCustomMessageQueue.Clear();
            }
        }
Esempio n. 5
0
 public void GetNextKey(GetKeyCallback callback, Action cancelCallback)
 {
     if (runner == null)
     {
         runner = CoroutineRunner.Instantiate(this.name + "_KeyGetter");
     }
     else if (nextKeyRoutine != null)
     {
         if (storedGetNextKeyCancel != null)
         {
             storedGetNextKeyCancel.Invoke();
         }
         runner.StopCoroutine(nextKeyRoutine);
     }
     storedGetNextKeyCancel = cancelCallback;
     nextKeyRoutine         = GetNextKeyRoutine(callback);
     runner.StartCoroutine(nextKeyRoutine);
 }
Esempio n. 6
0
    protected override void Apply(Transform other)
    {
        spawnPos = spawnOnInitialPos? spawnPos : transform.position;

        if (spawnRoutine != null)
        {
            runner.StopCoroutine(spawnRoutine);
        }

        base.Apply(other);

        if (timeToRespawn == 0)
        {
            Respawn();
        }
        else
        {
            spawnRoutine = toSpawnRoutine();
            runner.StartCoroutine(spawnRoutine);
        }
    }
Esempio n. 7
0
 public static void StopCoroutine(IEnumerator routine)
 {
     coroutineRunner.StopCoroutine(routine);
 }
Esempio n. 8
0
 public static void StopCoroutine(this Coroutine coroutine)
 {
     coroutineRunner.StopCoroutine(coroutine);
 }
 /// <summary>
 /// 停止协程
 /// </summary>
 /// <param name="coroutine"></param>
 public static void StopCoroutine(Coroutine coroutine)
 {
     m_coroutineRunner.StopCoroutine(coroutine);
 }