/// <summary> /// 线程。注意大部分Unity函数不能使用! 借用协程配合~ /// </summary> /// <param name="threadCalAction"></param> /// <returns></returns> public CAsync Thread(AsyncThreadDelegate threadCalAction) { return(Coroutine(_Thread((thread, next) => { threadCalAction(next); }))); }
public IEnumerator _Thread(AsyncThreadDelegate threadCalAction) { bool waitThreadFinish = false; var thread = new Thread(() => { Action customNext = () => { waitThreadFinish = true; }; threadCalAction(customNext); }); thread.Start(); while (!waitThreadFinish) { yield return(null); } }
public void SetMethod(AsyncThreadDelegate dlgt) { _dlgt = dlgt; }
public AsyncThread(AsyncThreadDelegate dlgt) { _queue = new Queue <object>(); }
public IEnumerator _Thread(AsyncThreadDelegate threadCalAction) { bool waitThreadFinish = false; var thread = new Thread(() => { Action customNext = () => { waitThreadFinish = true; }; threadCalAction(customNext); }); thread.Start(); while (!waitThreadFinish) yield return null; }
/// <summary> /// 线程。注意大部分Unity函数不能使用! 借用协程配合~ /// </summary> /// <param name="threadCalAction"></param> /// <returns></returns> public CAsync Thread(AsyncThreadDelegate threadCalAction) { return Coroutine(_Thread(threadCalAction)); }
/// <summary> /// 线程。注意大部分Unity函数不能使用! 借用协程配合~ /// </summary> /// <param name="threadCalAction"></param> /// <returns></returns> public CAsync Thread(AsyncThreadDelegate threadCalAction) { return(Coroutine(_Thread(threadCalAction))); }
/// <summary> /// 线程。注意大部分Unity函数不能使用! 借用协程配合~ /// </summary> /// <param name="threadCalAction"></param> /// <returns></returns> public CAsync Thread(AsyncThreadDelegate threadCalAction) { return Coroutine(_Thread((thread, next) => { threadCalAction(next); })); }