Пример #1
0
    /// <summary>
    /// 增加系统配置
    /// </summary>
    private void AddSysCtr()
    {
        m_Ctrs.Add(new CtrConfig()
        {
            m_Name     = "ReceiveMsg",
            m_Callback = (x) =>
            {
                m_ReceiveMsg = !m_ReceiveMsg;
                x.ChangeColor(m_ReceiveMsg ? Color.green : Color.white);
            },
            m_Color = m_ReceiveMsg ? Color.green : Color.white,
        });

        m_Ctrs.Add(new CtrConfig()
        {
            m_Name     = "ToBottom",
            m_Callback = (x) =>
            {
                m_ToBottom = !m_ToBottom;
                x.ChangeColor(m_ToBottom ? Color.green : Color.white);
                if (m_ToBottom)
                {
                    JerryEventMgr.DispatchEvent(Enum_Event.Change2Bottom.ToString());
                }
            },
            m_Color = m_ToBottom ? Color.green : Color.white,
        });

        m_Ctrs.Add(new CtrConfig()
        {
            m_Name     = "MessageReceived",
            m_Callback = (x) =>
            {
                m_UseMessageReceived = !m_UseMessageReceived;
                x.ChangeColor(m_UseMessageReceived ? Color.green : Color.white);
            },
            m_Color = m_UseMessageReceived ? Color.green : Color.white,
        });

        m_Ctrs.Add(new CtrConfig()
        {
            m_Name     = "TraceLev",
            m_Callback = (x) =>
            {
                m_TraceLev = ChangeTraceLev(m_TraceLev);
                x.ChangeColor(GetTraceLevColor(m_TraceLev));
            },
            m_Color = GetTraceLevColor(m_TraceLev),
        });
    }
Пример #2
0
    private TraceLev ChangeTraceLev(TraceLev lev)
    {
        switch (lev)
        {
        case TraceLev.None:
        {
            return(TraceLev.Simple);
        }

        case TraceLev.Simple:
        {
            return(TraceLev.Full);
        }

        case TraceLev.Full:
        {
            return(TraceLev.None);
        }
        }
        return(TraceLev.None);
    }
Пример #3
0
    private Color GetTraceLevColor(TraceLev lev)
    {
        switch (lev)
        {
        case TraceLev.None:
        {
            return(Color.white);
        }

        case TraceLev.Simple:
        {
            return(Color.cyan);
        }

        case TraceLev.Full:
        {
            return(Color.green);
        }
        }
        return(Color.white);
    }