static void OnCoroutineMessage(EditorCoroutineMessage msg) { if (msg.msg == EditorCoroutineMessage.Message.PROGRESS_UI) { EditorUIProgressInfo progressInfo = msg.param0 as EditorUIProgressInfo; float progress = ((float)progressInfo.curr) / ((float)progressInfo.total); EditorUtility.DisplayProgressBar("正在扫描", progressInfo.msg, progress); } }
private void _PostUIProgressMessage() { EditorUIProgressInfo progressInfo = new EditorUIProgressInfo(); progressInfo.msg = msg; progressInfo.curr = curr; progressInfo.total = total; EditorCoroutineMessage newMsg = new EditorCoroutineMessage(taskID, EditorCoroutineMessage.Message.PROGRESS_UI, progressInfo, null); Co.PostUIMessage(newMsg); }
void ProcessCoroutineUIMessage() { EditorCoroutineMessage msg = null; //Debug.Log("点击刷新?"+msg.taskID.ToString()); while ((msg = GetCoroutine().GetUIMessage()) != null) { Debug.Log("进入1?"); if (onCoroutineMessage != null) { Debug.Log("进入2"); onCoroutineMessage(msg); } } }
private void _ProcessCurrMessages() { while (msgQueue.Count > 0) { EditorCoroutineMessage msg = msgQueue.Dequeue(); foreach (var t in taskList) { if (msg.taskID != t.TaskID) { continue; } switch (msg.msg) { case EditorCoroutineMessage.Message.CANCEL_TASK: t.Cancel(); break; default: break; } } } }
public void PostUIMessage(EditorCoroutineMessage msg) { uiMsgQueue.Enqueue(msg); }
public void PostTaskMessage(EditorCoroutineMessage msg) { msgQueue.Enqueue(msg); }