Example #1
0
        private Coroutine InvokePrivate(float delay, System.Action action)
        {
            if (delay == 0.0f)
            {
                action.Invoke();
                return(null);
            }

            if (!Panel.gameObject.activeInHierarchy)
            {
                return(null);
            }

            var enumerator = InvokeHelper(new WaitForSeconds(delay), action);

            enumerators.Add(enumerator);
            if (!Application.isPlaying)
            {
                                #if UNITY_EDITOR
                EditorCoroutine.StartCoroutine(enumerator, Panel);
                                #endif
                return(null);
            }

            return(Panel.StartCoroutine(enumerator));
        }
Example #2
0
        private Coroutine Invoke(YieldInstruction instruction, System.Action action)
        {
            if (!Panel.gameObject.activeInHierarchy)
            {
                return(null);
            }
            if (Application.isPlaying)
            {
                                #if UNITY_EDITOR
                EditorCoroutine.StartCoroutine(InvokeHelper(instruction, action), Panel);
                                #endif
                return(null);
            }

            return(Panel.StartCoroutine(InvokeHelper(instruction, action)));
        }
 public static void StartCoroutine(this EditorWindow thisRef, string methodName, object value)
 {
     EditorCoroutine.StartCoroutine(methodName, value, thisRef);
 }
 public static void StartCoroutine(this EditorWindow thisRef, IEnumerator coroutine)
 {
     EditorCoroutine.StartCoroutine(coroutine, thisRef);
 }