Exemplo n.º 1
0
        public void SendActionRequest(UIActionRequest _newAction)
        {
            // 当前的队列数大于规定最大队列数,拒绝请求
            if (m_RequestQueue.Count > QueueLength)
            {
                return;
            }

            // 加入队列
            m_RequestQueue.Enqueue(_newAction);

            // 如果队列协成没有启动,则启动
            if (!m_isExcuterRunning)
            {
                StartCoroutine("_ActionExcuter");
            }
        }
Exemplo n.º 2
0
        private IEnumerator _ActionExcuter()
        {
            m_isExcuterRunning = true;

            while (m_RequestQueue.Count > 0)
            {
                UIActionRequest _action = m_RequestQueue.Dequeue();

                On_RequestFinish = UIActionDispatcher.DispatchAction(_action.ActionOwner, _action.ActionType);

                yield return(new WaitForSeconds(_action.ActionDuring + QueueSnap));

                if (On_RequestFinish != null)
                {
                    On_RequestFinish();
                }
            }

            m_isExcuterRunning = false;
        }
Exemplo n.º 3
0
 public void SendActionRequest(UIActionRequest _request)
 {
     m_SyncManager.SendActionRequest(_request);
 }