public void Update()
    {
        m_MsgCallList.BeginUpdate();
        int errorId = 0;

        try
        {
            //process msglist message
            for (int i = 0; i < 16; ++i)
            {
                MessageObject elem = m_MsgList.Poll();
                if (null == elem)
                {
                    break;
                }

                m_AllMessageListenerList.ExcutionUpdateList(elem);

                errorId = elem.msgId;
                m_MsgCallList.Update(elem.msgId, elem);
            }
        }
        catch (Exception e)
        {
            //log error
            Debug.LogError("Wrong msg callback" + errorId + "error log: " + e.Message);
        }
        m_MsgCallList.EndUpdate();
    }
Esempio n. 2
0
    private void UpdateBeginCd(int deltaTime)
    {
        if (m_BeginCdStore.Count <= 0)
        {
            return;
        }

        //begin update
        m_BeginCdListenerList.BeginUpdate();

        foreach (var elem in m_BeginCdStore)
        {
            elem.Value.cd -= deltaTime;

            //update listener
            m_BeginCdListenerList.Update(elem.Key, elem.Value.cd);

            if (elem.Value.cd <= 0)
            {
                // trigger play
                TriggerExecSkill(elem.Value.user, elem.Value.config);

                //add to remove store;
                m_RemoveingBeginCdStore.Add(elem.Key);
            }
        }

        //end upate
        m_BeginCdListenerList.EndUpdate();

        if (m_RemoveingBeginCdStore.Count == m_BeginCdStore.Count)
        {
            m_BeginCdStore.Clear();
            m_RemoveingBeginCdStore.Clear();
        }
        else
        {
            for (int i = 0; i < m_RemoveingBeginCdStore.Count; ++i)
            {
                //do remove
                m_BeginCdStore.Remove(m_RemoveingBeginCdStore[i]);
            }
            m_RemoveingBeginCdStore.Clear();
        }
    }
Esempio n. 3
0
    private void UpdateCd(int deltaTime)
    {
        if (m_CdStore.Count <= 0)
        {
            return;
        }

        //begin update
        m_ListenerList.BeginUpdate();

        foreach (var elem in m_CdStore)
        {
            elem.Value.cd -= deltaTime;

            //update listener
            m_ListenerList.Update(elem.Key, elem.Value.cd);

            if (elem.Value.cd <= 0)
            {
                //add to remove store;
                m_RemoveingCdStore.Add(elem.Key);
            }
        }

        //end upate
        m_ListenerList.EndUpdate();

        if (m_RemoveingCdStore.Count == m_CdStore.Count)
        {
            m_CdStore.Clear();
            m_RemoveingCdStore.Clear();
        }
        else
        {
            for (int i = 0; i < m_RemoveingCdStore.Count; ++i)
            {
                m_CdStore.Remove(m_RemoveingCdStore[i]);
            }
            m_RemoveingCdStore.Clear();
        }
    }