Exemplo n.º 1
0
            public void OpenPanel()
            {
                if (m_NextMaster == m_CurrentMaster)
                {
                    return;
                }

                if (m_NextMaster < 0)
                {
                    m_CurrentMaster = m_NextMaster;
                    return;
                }

                if (m_Panel == null)//这个条件的检测反而比较少
                {
                    return;
                }

                m_CurrentMaster = m_NextMaster;

                OpenParam info = GetOpenInfo(m_CurrentMaster);

                if (info == null)
                {
                    m_CurrentMaster = m_NextMaster = -1;
                    return;
                }

                ERunner.Run(m_Panel.OnPanelOpen, true, info.Args);

                ERunner.Run(CallOpenCallbck);
            }
Exemplo n.º 2
0
 public void OnPanelOpen(bool firstOpen, params object[] args)
 {
     m_LastOpenFrame = Time.frameCount;
     SendViewEvent(ViewEvent.OnPanelOpen);
     ERunner.Run(OnPanelOpen, args);
     SendViewEvent(ViewEvent.OnParamUpdate);
 }
Exemplo n.º 3
0
 public void OpenPage()
 {
     if (!m_HasOpen)
     {
         m_HasOpen = true;
         ERunner.Run(OnOpen);
     }
 }
Exemplo n.º 4
0
 private void ClosePage()
 {
     if (m_HasOpen)
     {
         m_HasOpen = false;
         UnRegisterAllEvent();
         ERunner.Run(OnClose);
     }
 }
Exemplo n.º 5
0
 protected void Awake()
 {
     if (!m_HasInitUI)
     {
         m_HasInitUI = true;
         RegisterParentPanelEvent();
         ERunner.Run(OnUIInit);
     }
 }
Exemplo n.º 6
0
        protected void OnParentPanelEvent(int key, params object[] args)
        {
            if (args == null || args.Length <= 0)
            {
                return;
            }

            ViewEvent e = (ViewEvent)args[0];

            //默认事件已经处理了
            switch (e)
            {
            case ViewEvent.OnPanelClose:
                ClosePage();
                break;

            case ViewEvent.OnPanelOpen:
                OpenPage();
                break;

            case ViewEvent.OnParamUpdate:
                ERunner.Run(OnParamUpdate);
                break;

            default:
                break;
            }

            object[] newArgs = null;

            if (args.Length > 1)
            {
                newArgs = new object[args.Length - 1];
                for (int i = 0; i < newArgs.Length; ++i)
                {
                    newArgs[i] = args[i + 1];
                }
            }

            ERunner.Run(OnViewEvent, e, newArgs);
        }