Esempio n. 1
0
    public static void StopAll()
    {
        if (_routines == null)
        {
            return;
        }

        for (int i = _routines.Count - 1; i >= 0; --i)
        {
            _instance.StopCoroutine(_routines[i]);
        }
        _routines.Clear();
    }
Esempio n. 2
0
 public void Stop()
 {
     CoroutineUtil.StopCoroutine(CountDown());
     _count    = 0;
     _delay    = 0;
     _interval = 0;
     _callback = null;
 }
Esempio n. 3
0
 static void Remove(IEnumerator value)
 {
     if (value == null)
     {
         return;
     }
     _routines.Remove(value);
     _instance.StopCoroutine(value);
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         CoroutineUtil.StopCoroutine("aa");
     }
     if (Input.GetKeyDown(KeyCode.B))
     {
         CoroutineUtil.StopCoroutine("bb");
     }
 }
Esempio n. 5
0
 /// <summary>
 /// 从SceneInfo配置中加载一个场景,这个场景一定是Unity场景
 /// 所有场景都以异步形式加载
 /// </summary>
 /// <param name="pSceneInfoID"></param>
 public void LoadScene(int pSceneID)
 {
     _sceneInfo = DataConfigManager.GetInstance().GetConfigData <SceneInfo>(DataConfigDefine.SceneInfo, pSceneID);
     if (_sceneInfo != null)
     {
         if (_asyncOperation != null)
         {
             CoroutineUtil.StopCoroutine(StartLoadSceneAsync());
             TimeManager.GetInstance().UpdateEvent -= Update;
         }
         TimeManager.GetInstance().UpdateEvent += Update;
         CoroutineUtil.StartCoroutine(StartLoadSceneAsync());
     }
     else
     {
         LogManager.Error("Load scene data is null:" + pSceneID);
     }
 }