public void CloseForm(IUIForm form) { if (!form.IsShow) { return; } if (form == m_Forms.Last.Value) { IUIForm prevForm = m_Forms.Last.Previous == null ? null : m_Forms.Last.Previous.Value; if (prevForm != null && prevForm.IsShow) { prevForm.OnFocus(); } else { m_CurrentDepth = 0; } } m_Forms.Remove(form); m_Forms.AddFirst(form); form.OnClose(); }