public void ManualStop() { if (co != null) { CoRef.StopCoroutineAway(co); } }
private void OnDisable() { if (co != null) { CoRef.StopCoroutineAway(co); } }
private void Start() { if (CountOnStart) { co = CoRef.StartCoroutineAway(InvokeAfterCO(secounds)); } }
private void OnEnable() { if (CountOnEnable) { co = CoRef.StartCoroutineAway(InvokeAfterCO(secounds)); } }
public static void CreateCorotineReferance() { if (!instance) { GameObject gameObject = new GameObject("GameEventCorotuineStarter"); instance = gameObject.AddComponent <CoRef>(); } }
private void Awake() { if (!instance) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(this); } }
public void ManualStart(float secounds) { ManualStop(); co = CoRef.StartCoroutineAway(InvokeAfterCO(secounds)); }
public static Coroutine InvokeAfterDelay(float delay, Action callback) { return(CoRef.StartCoroutineAway(_WaitForSeconds(delay, callback))); }
public static void Stop(Coroutine co) { CoRef.StopCoroutineAway(co); }
public static Coroutine InvokeWhen(Action callback, Func <bool> predect) { return(CoRef.StartCoroutineAway(_WaitUntil(callback, predect))); }
public static Coroutine InvokeEndOfFrame(Action callback) { return(CoRef.StartCoroutineAway(_WaitForEndOfFrame(callback))); }