Пример #1
0
        private void openSwitch(GameEvent e)
        {
            Variant d    = e.data;
            string  name = d["name"];
            Variant info = null;

            if (d.ContainsKey("data"))
            {
                info = d["data"] as Variant;
            }
            if (!(m_uiCtrlMap.ContainsKey(name)))
            {
                _openUI(name, info);
                return;
            }
            BaseLGUI lgui = m_uiCtrlMap[name] as BaseLGUI;

            if (lgui.isOpen)
            {
                lgui.close();
            }
            else
            {
                lgui.open(info);
            }
        }
Пример #2
0
        private void openSwitch(GameEvent e)
        {
            Variant data  = e.data;
            string  text  = data["name"];
            Variant data2 = null;
            bool    flag  = data.ContainsKey("data");

            if (flag)
            {
                data2 = data["data"];
            }
            bool flag2 = !this.m_uiCtrlMap.ContainsKey(text);

            if (flag2)
            {
                this._openUI(text, data2);
            }
            else
            {
                BaseLGUI baseLGUI = this.m_uiCtrlMap[text];
                bool     isOpen   = baseLGUI.isOpen;
                if (isOpen)
                {
                    baseLGUI.close();
                }
                else
                {
                    baseLGUI.open(data2);
                }
            }
        }