/// <summary> /// 从界面组移除界面。 /// </summary> /// <param name="uiForm">要移除的界面。</param> public void RemoveUIForm(IUIForm uiForm) { UIFormInfo uiFormInfo = GetUIFormInfo(uiForm); if (uiFormInfo == null) { throw new GameFrameworkException(Utility.Text.Format("Can not find UI form info for serial id '{0}', UI form asset name is '{1}'.", uiForm.SerialId.ToString(), uiForm.UIFormAssetName)); } if (!uiFormInfo.Covered) { uiFormInfo.Covered = true; uiForm.OnCover(); } if (!uiFormInfo.Paused) { uiFormInfo.Paused = true; uiForm.OnPause(); } if (m_CachedNode != null && m_CachedNode.Value.UIForm == uiForm) { m_CachedNode = m_CachedNode.Next; } if (!m_UIFormInfos.Remove(uiFormInfo)) { throw new GameFrameworkException(Utility.Text.Format("UI group '{0}' not exists specified UI form '[{1}]{2}'.", m_Name, uiForm.SerialId.ToString(), uiForm.UIFormAssetName)); } ReferencePool.Release(uiFormInfo); }
public void OpenForm(IUIForm form) { if (!form.IsShow) { if (m_Forms.Last.Value != form) { m_Forms.Remove(form); m_Forms.AddLast(form); } form.Depth = ++m_CurrentDepth; form.OnOpen(); IUIForm prevForm = m_Forms.Last.Previous == null ? null : m_Forms.Last.Previous.Value; if (prevForm != null && prevForm.IsShow) { prevForm.OnCover(); } } }
/// <summary> /// 从界面组移除界面。 /// </summary> /// <param name="uiForm">要移除的界面。</param> public void RemoveUIForm(IUIForm uiForm) { UIFormInfo uiFormInfo = GetUIFormInfo(uiForm); Guard.Requires <ArgumentException>(uiForm != null, $"Can not find UI form asset name is '{uiForm.UIFormAssetName}'."); if (!uiFormInfo.Covered) { uiFormInfo.Covered = true; uiForm.OnCover(); } if (!uiFormInfo.Paused) { uiFormInfo.Paused = true; uiForm.OnPause(); } m_UIFormInfos.Remove(uiFormInfo); }
/// <summary> /// 从界面组移除界面。 /// </summary> /// <param name="uiForm">要移除的界面。</param> public void RemoveUIForm(IUIForm uiForm) { UIFormInfo uiFormInfo = GetUIFormInfo(uiForm); if (uiFormInfo == null) { throw new GameFrameworkException(Utility.Text.Format("Can not find UI form info for serial id '{0}', UI form asset name is '{1}'.", uiForm.SerialId.ToString(), uiForm.UIFormAssetName)); } if (!uiFormInfo.Covered) { uiFormInfo.Covered = true; uiForm.OnCover(); } if (!uiFormInfo.Paused) { uiFormInfo.Paused = true; uiForm.OnPause(); } m_UIFormInfos.Remove(uiFormInfo); }
/// <summary> /// 从界面组移除界面。 /// </summary> /// <param name="uiForm">要移除的界面。</param> public void RemoveUIForm(IUIForm uiForm) { UIFormInfo uiFormInfo = GetUIFormInfo(uiForm); if (uiFormInfo == null) { throw new GameFrameworkException(string.Format("Can not find UI form info for type '{0}'.", uiForm.TypeId.ToString())); } if (!uiFormInfo.Covered) { uiFormInfo.Covered = true; uiForm.OnCover(); } if (!uiFormInfo.Paused) { uiFormInfo.Paused = true; uiForm.OnPause(); } m_UIFormInfos.Remove(uiFormInfo); }