public void OpenPanel() { if (m_NextMaster == m_CurrentMaster) { return; } if (m_NextMaster < 0) { m_CurrentMaster = m_NextMaster; return; } if (m_Panel == null || !m_Panel.gameObject.activeSelf)//这个条件的检测反而比较少 { 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); }
public void OnPanelOpen(bool firstOpen, params object[] args) { m_LastOpenFrame = Time.frameCount; SendViewEvent(ViewEvent.OnPanelOpen); ERunner.Run(OnPanelOpen, args); SendViewEvent(ViewEvent.OnParamUpdate); }
protected void Awake() { if (!m_HasInitUI) { m_HasInitUI = true; RegisterParentPanelEvent(); ERunner.Run(OnUIInit); } }
public void OpenPage() { if (!m_HasOpen) { m_HasOpen = true; ERunner.Run(OnOpen); if (m_ParentPage == null) { UIMgr.S.LogPanelOpen(uiName, m_PanelEventLogType); } } }
private void ClosePage() { if (m_HasOpen) { m_HasOpen = false; UnRegisterAllEvent(); ERunner.Run(OnClose); if (m_ParentPage == null) { UIMgr.S.LogPanelClose(uiName, m_PanelEventLogType); } } }
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; case ViewEvent.OnSortingLayerUpdate: ERunner.Run(OnSortingLayerUpdate); 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); }