Пример #1
0
 private void CloseForm(bool isShutdown = false)
 {
     if (m_Form != null)
     {
         m_Form.Close(isShutdown);
         m_Form = null;
     }
 }
Пример #2
0
        public void ActiveUIForm(UIFormId uiFormId)
        {
            UGuiForm uiForm = GameEntry.UI.GetUIForm(uiFormId);

            if (uiForm != null)
            {
                uiForm.gameObject.SetActive(true);
            }
        }
Пример #3
0
        private void OnOpenUIFormSuccess(object sender, GameEventArgs e)
        {
            OpenUIFormSuccessEventArgs ne = (OpenUIFormSuccessEventArgs)e;

            if (ne.UserData != this)
            {
                return;
            }

            m_Form = (UGuiForm)ne.UIForm.Logic;
        }
Пример #4
0
        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;
            }
        }
Пример #5
0
        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);
            }));
        }
Пример #6
0
        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");
        }
Пример #7
0
 public static void CloseUIForm(this UIComponent uiComponent, UGuiForm uiForm)
 {
     uiComponent.CloseUIForm(uiForm.UIForm);
 }