Exemple #1
0
        private void LoadFont(string fontName)
        {
            m_LoadedFlag.Add(string.Format("Font.{0}", fontName), false);
            GameEntry.Resource.LoadAsset(AssetUtility.GetFontAsset(fontName), 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);
            }));
        }
 /// <summary>
 /// 关闭界面
 /// </summary>
 /// <param name="uiForm">要关闭的界面</param>
 public static void CloseUIForm(this UIComponent uiComponent, UGuiForm uiForm)
 {
     uiComponent.CloseUIForm(uiForm.UIForm);
 }