/// <summary> /// 等待知道 /// </summary> public static float WaitUntil(Func <bool> condition) { // E_CoroutineType.update lock (lock_object) ReplaceCoroutine = ReCoroutineManager.AddCoroutine(GetReplaceCoroutine(condition)); return(float.NaN); }
/// <summary> /// 等待异步操作 /// </summary> public static float WaitAsynOperation(AsyncOperation operation) { lock (lock_object) { // E_CoroutineType.update ReplaceCoroutine = ReCoroutineManager.AddCoroutine(GetReplaceCoroutine(() => operation.isDone)); } return(float.NaN); }
/// <summary> /// 等待www返回 /// </summary> public static float WaitWww(WWW www) { lock (lock_object) { // E_CoroutineType.update ReplaceCoroutine = ReCoroutineManager.AddCoroutine(GetReplaceCoroutine(() => www.isDone)); } return(float.NaN); }
/// <summary> /// 等待所有其他携程 /// </summary> public static float WaitForAllCoroutines(params ReCoroutine[] coroutines) { // E_CoroutineType.update lock (lock_object) ReplaceCoroutine = ReCoroutineManager.AddCoroutine( GetReplaceCoroutine(() => { int length = coroutines.Length; for (int i = 0; i < length; i++) { if (!coroutines[i].IsDone) { return(false); } } return(true); })); return(float.NaN); }
/// <summary> /// 等待其他协程 /// </summary> public static float Wait(IEnumerator <float> e) { lock (lock_object) ReplaceCoroutine = ReCoroutineManager.AddCoroutine(e); return(float.NaN); }
public void Start() { Running = true; IsFinished = false; ReCoroutineManager.AddCoroutine(_do_task()); }