private void CloseForm(bool isShutdown = false) { if (m_Form != null) { m_Form.Close(isShutdown); m_Form = null; } }
public void ActiveUIForm(UIFormId uiFormId) { UGuiForm uiForm = GameEntry.UI.GetUIForm(uiFormId); if (uiForm != null) { uiForm.gameObject.SetActive(true); } }
private void OnOpenUIFormSuccess(object sender, GameEventArgs e) { OpenUIFormSuccessEventArgs ne = (OpenUIFormSuccessEventArgs)e; if (ne.UserData != this) { return; } m_Form = (UGuiForm)ne.UIForm.Logic; }
protected override void OnLeave(ProcedureOwner procedureOwner, bool isShutdown) { base.OnLeave(procedureOwner, isShutdown); GameEntry.Event.Unsubscribe(OpenUIFormSuccessEventArgs.EventId, OnOpenUIFormSuccess); if (m_Form != null) { m_Form.Close(isShutdown); m_Form = null; } }
private void LoadFont(string fontName) { m_LoadedFlag.Add(string.Format("Font.{0}", fontName), false); GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), Constant.AssetPriority.FontAsset, new LoadAssetCallbacks( (assetName, asset, duration, userData) => { m_LoadedFlag[string.Format("Font.{0}", fontName)] = true; UGuiForm.SetMainFont((Font)asset); Log.Info("Load font '{0}' OK.", fontName); }, (assetName, status, errorMessage, userData) => { Log.Error("Can not load font '{0}' from '{1}' with error message '{2}'.", fontName, assetName, errorMessage); })); }
private void OnOpenUIFormSuccess(object sender, GameEventArgs e) { OpenUIFormSuccessEventArgs ne = (OpenUIFormSuccessEventArgs)e; if (ne.UserData != this) { return; } m_Form = (UGuiForm)ne.UIForm.Logic; if (m_Form.name.StartsWith("HallForm")) { HallForm m_HallForm = (HallForm)m_Form; m_HallForm.SetDiamondValue(9); m_HallForm.SetGoldValue(999); m_HallForm.SetUsername("Victor"); } //GameObject hallForm = GameObject.Find("HallForm"); }
public static void CloseUIForm(this UIComponent uiComponent, UGuiForm uiForm) { uiComponent.CloseUIForm(uiForm.UIForm); }