Exemplo n.º 1
0
        public static void StopAll()
        {
            if (Application.isPlaying)
            {
                Instance.StopAllCoroutines();
            }
            else
            {
#if UNITY_EDITOR
                EditorCoroutineRunner.StopAllEditorCoroutine();
#endif
            }
        }
Exemplo n.º 2
0
        public static void Stop(IEnumerator function)
        {
            if (Application.isPlaying)
            {
                Instance.StopCoroutine(function);
            }
            else
            {
#if UNITY_EDITOR
                EditorCoroutineRunner.StopEditorCoroutine(function);
#endif
            }
        }
Exemplo n.º 3
0
        public static Coroutine Run(IEnumerator function)
        {
            if (Application.isPlaying)
            {
                return(Instance.StartCoroutine(function));
            }
            else
            {
#if UNITY_EDITOR
                //处理编辑器没有运行的情况
                EditorCoroutineRunner.StartEditorCoroutine(function);
#endif
                return(null);
            }
        }