private void InternalOpenUIForm(int serialId, string uiFormAssetName, UIGroup uiGroup, object uiFormInstance, bool pauseCoveredUIForm, bool isNewInstance, float duration, object userData) { try { IUIForm uiForm = m_UIFormHelper.CreateUIForm(uiFormInstance, uiGroup, userData); if (uiForm == null) { throw new GameFrameworkException("Can not create UI form in helper."); } uiForm.OnInit(serialId, uiFormAssetName, uiGroup, pauseCoveredUIForm, isNewInstance, userData); uiGroup.AddUIForm(uiForm); uiForm.OnOpen(userData); uiGroup.Refresh(); if (m_OpenUIFormSuccessEventHandler != null) { OpenUIFormSuccessEventArgs openUIFormSuccessEventArgs = OpenUIFormSuccessEventArgs.Create(uiForm, duration, userData); m_OpenUIFormSuccessEventHandler(this, openUIFormSuccessEventArgs); ReferencePool.Release(openUIFormSuccessEventArgs); } } catch (Exception exception) { if (m_OpenUIFormFailureEventHandler != null) { OpenUIFormFailureEventArgs openUIFormFailureEventArgs = OpenUIFormFailureEventArgs.Create(serialId, uiFormAssetName, uiGroup.Name, pauseCoveredUIForm, exception.ToString(), userData); m_OpenUIFormFailureEventHandler(this, openUIFormFailureEventArgs); ReferencePool.Release(openUIFormFailureEventArgs); return; } throw; } }
private void OnOpenUIFormSuccess(object sender, GameFramework.UI.OpenUIFormSuccessEventArgs e) { if (m_EnableOpenUIFormSuccessEvent) { m_EventComponent.Fire(this, new OpenUIFormSuccessEventArgs(e)); } }
private void OnOpenUIFormSuccess(object sender, GameFramework.UI.OpenUIFormSuccessEventArgs e) { if (m_EnableOpenUIFormSuccessEvent) { m_EventComponent.Fire(this, ReferencePool.Acquire <OpenUIFormSuccessEventArgs>().Fill(e)); } }
private void OnOpenUIFormSuccess(object sender, GameFramework.UI.OpenUIFormSuccessEventArgs e) { m_EventComponent.Fire(this, OpenUIFormSuccessEventArgs.Create(e)); SetEntityTcs(e.UIForm.SerialId, e.UIForm); UIFormTcsDict.Remove(e.UIForm.SerialId); }
/// <summary> /// 填充打开界面成功事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>打开界面成功事件。</returns> public OpenUIFormSuccessEventArgs Fill(GameFramework.UI.OpenUIFormSuccessEventArgs e) { UIForm = e.UIForm; Duration = e.Duration; UserData = e.UserData; return(this); }
/// <summary> /// 创建打开界面成功事件。 /// </summary> /// <param name="e">内部事件。</param> /// <returns>创建的打开界面成功事件。</returns> public static OpenUIFormSuccessEventArgs Create(GameFramework.UI.OpenUIFormSuccessEventArgs e) { OpenUIFormSuccessEventArgs openUIFormSuccessEventArgs = ReferencePool.Acquire <OpenUIFormSuccessEventArgs>(); openUIFormSuccessEventArgs.UIForm = e.UIForm; openUIFormSuccessEventArgs.Duration = e.Duration; openUIFormSuccessEventArgs.UserData = e.UserData; return(openUIFormSuccessEventArgs); }
private void OnOpenUIFormSuccess(object sender, GameFramework.UI.OpenUIFormSuccessEventArgs e) { m_EventComponent.Fire(this, OpenUIFormSuccessEventArgs.Create(e)); }