예제 #1
0
 public void StopCoroutine(IEnumerator routine)
 {
     if (routine == null)
     {
         return;
     }
     _coroutineRunner.StopCoroutine(routine);
 }
예제 #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;
        }
예제 #4
0
        private static void StopGlobalCustomMessageQueue(bool clearQueue = false)
        {
            if (_globalCustomMessageQueueRoutine != null)
            {
                CoroutineRunner.StopCoroutine(_globalCustomMessageQueueRoutine);
                _globalCustomMessageQueueRoutine = null;
            }

            if (clearQueue)
            {
                _globalCustomMessageQueue.Clear();
            }
        }
예제 #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);
 }
예제 #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);
        }
    }
예제 #7
0
 public static void StopCoroutine(IEnumerator routine)
 {
     coroutineRunner.StopCoroutine(routine);
 }
예제 #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);
 }