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);
     }
 }
예제 #2
0
    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);
    }
예제 #3
0
    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);
            }
        }
    }
예제 #4
0
    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;
                }
            }
        }
    }
예제 #5
0
 public void PostUIMessage(EditorCoroutineMessage msg)
 {
     uiMsgQueue.Enqueue(msg);
 }
예제 #6
0
 public void PostTaskMessage(EditorCoroutineMessage msg)
 {
     msgQueue.Enqueue(msg);
 }