hexiaojie 8 ay önce
ebeveyn
işleme
69c644675c

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -12,6 +12,7 @@ namespace GFGGame
 
         public static void ShowLogin()
         {
+            Debug.Log($"ShowLogin");
             ViewManager.Show<LoginView>();
         }
 

+ 103 - 35
GameClient/Assets/Game/HotUpdate/FairyGUI/GFGUIPackage.cs

@@ -1,4 +1,5 @@
-using FairyGUI;
+using System;
+using FairyGUI;
 using System.Collections.Generic;
 using UnityEngine;
 using YooAsset;
@@ -9,7 +10,10 @@ namespace GFGGame
     public class GFGUIPackage
     {
         private static Dictionary<string, UIPackage> _packages = new Dictionary<string, UIPackage>();
-        private static Dictionary<string, List<AssetOperationHandle>> assetHandleCacheDic = new Dictionary<string, List<AssetOperationHandle>>();
+
+        private static Dictionary<string, List<AssetOperationHandle>> assetHandleCacheDic =
+            new Dictionary<string, List<AssetOperationHandle>>();
+
         private static Dictionary<string, int> _assetCount = new Dictionary<string, int>();
 
         // public static void AddPackage(string descFilePath)
@@ -42,51 +46,113 @@ namespace GFGGame
 
         public static async Task AddPackageAsync(string descFilePath)
         {
+            // 打印开始加载信息
+            Debug.Log($"开始加载UI包: {descFilePath}");
+
             _assetCount.TryGetValue(descFilePath, out var count);
             if (count > 0)
             {
                 _assetCount[descFilePath] = count + 1;
+                Debug.Log($"{descFilePath} 已引用,引用计数+1 (当前: {count + 1})");
                 return;
             }
+
             _assetCount.Add(descFilePath, count + 1);
-            var handle = YooAssets.LoadAssetAsync<TextAsset>($"{descFilePath}_fui.bytes");
-            await handle.Task;
-            TextAsset textAsset = handle.AssetObject as TextAsset;
-            CacheAssetHandle(descFilePath, handle);
-            var uiPackage = UIPackage.AddPackage(textAsset.bytes, descFilePath, (string name, string extension, System.Type type, PackageItem item) =>
+
+            try
             {
-                string location = name + extension;
-                if (!YooAssets.CheckResExist(location))
-                {
-                    return;
-                }
-                AssetOperationHandle handle = YooAssets.LoadAssetAsync(location, type);
-                CacheAssetHandle(descFilePath, handle);
-                handle.Completed += (handle) =>
+                // 加载主资源
+                Debug.Log($"正在加载描述文件: {descFilePath}_fui.bytes");
+                var handle = YooAssets.LoadAssetAsync<TextAsset>($"{descFilePath}_fui.bytes");
+                await handle.Task;
+
+                if (handle.Status == EOperationStatus.Succeed)
                 {
-                    if (handle.AssetObject == null) return;
-                    Texture tex = handle.AssetObject as Texture;
-                    if (tex != null)
-                    {
-                        string location = name + "!a" + extension;
-                        if (YooAssets.CheckResExist(location))
+                    Debug.Log($"描述文件加载成功: {descFilePath}_fui.bytes");
+                    TextAsset textAsset = handle.AssetObject as TextAsset;
+                    CacheAssetHandle(descFilePath, handle);
+
+                    // 添加UI包
+                    Debug.Log($"正在添加UI包: {descFilePath}");
+                    var uiPackage = UIPackage.AddPackage(textAsset.bytes, descFilePath,
+                        (string name, string extension, System.Type type, PackageItem item) =>
                         {
-                            AssetOperationHandle handleAlpha = YooAssets.LoadAssetAsync(location, type);
-                            CacheAssetHandle(descFilePath, handleAlpha);
-                            handleAlpha.Completed += (handle1) =>
+                            string location = name + extension;
+                            Debug.Log($"正在加载依赖资源: {location}");
+
+                            if (!YooAssets.CheckResExist(location))
                             {
-                                if (handle1.AssetObject == null) return;
-                                Texture alphaTex = handle1.AssetObject as Texture;
-                                item.owner.SetItemAsset(item, tex, alphaTex, DestroyMethod.None);//注意:这里一定要设置为None
+                                Debug.LogWarning($"依赖资源不存在: {location}");
+                                return;
+                            }
+
+                            AssetOperationHandle handle = YooAssets.LoadAssetAsync(location, type);
+                            CacheAssetHandle(descFilePath, handle);
+                            handle.Completed += (handle) =>
+                            {
+                                if (handle.Status != EOperationStatus.Succeed)
+                                {
+                                    Debug.LogError($"依赖资源加载失败: {location}");
+                                    return;
+                                }
+
+                                if (handle.AssetObject == null)
+                                {
+                                    Debug.LogWarning($"依赖资源为空: {location}");
+                                    return;
+                                }
+
+                                Debug.Log($"依赖资源加载成功: {location}");
+                                Texture tex = handle.AssetObject as Texture;
+                                if (tex != null)
+                                {
+                                    string location = name + "!a" + extension;
+                                    Debug.Log($"检测透明通道资源: {location}");
+
+                                    if (YooAssets.CheckResExist(location))
+                                    {
+                                        AssetOperationHandle handleAlpha = YooAssets.LoadAssetAsync(location, type);
+                                        CacheAssetHandle(descFilePath, handleAlpha);
+                                        handleAlpha.Completed += (handle1) =>
+                                        {
+                                            if (handle1.Status != EOperationStatus.Succeed)
+                                            {
+                                                Debug.LogError($"透明通道资源加载失败: {location}");
+                                                return;
+                                            }
+
+                                            if (handle1.AssetObject == null)
+                                            {
+                                                Debug.LogWarning($"透明通道资源为空: {location}");
+                                                return;
+                                            }
+
+                                            Debug.Log($"透明通道资源加载成功: {location}");
+                                            Texture alphaTex = handle1.AssetObject as Texture;
+                                            item.owner.SetItemAsset(item, tex, alphaTex, DestroyMethod.None);
+                                        };
+                                        return;
+                                    }
+                                }
+
+                                item.owner.SetItemAsset(item, handle.AssetObject, null, DestroyMethod.None);
                             };
-                            return;
-                        }
-                    }
-                    item.owner.SetItemAsset(item, handle.AssetObject, null, DestroyMethod.None);//注意:这里一定要设置为None
-                };
-            });
-            _packages.Add(descFilePath, uiPackage);
-            CheckRemovePackage(descFilePath);
+                        });
+
+                    _packages.Add(descFilePath, uiPackage);
+                    Debug.Log($"UI包添加完成: {descFilePath}");
+                    CheckRemovePackage(descFilePath);
+                }
+                else
+                {
+                    Debug.LogError($"描述文件加载失败: {descFilePath}_fui.bytes, 错误: {handle.LastError}");
+                }
+            }
+            catch (Exception ex)
+            {
+                Debug.LogError($"加载UI包异常: {descFilePath}, 错误: {ex.Message}");
+                throw;
+            }
         }
 
 
@@ -117,6 +183,7 @@ namespace GFGGame
                 {
                     asset.Release();
                 }
+
                 list.Clear();
             }
         }
@@ -129,6 +196,7 @@ namespace GFGGame
                 list = new List<AssetOperationHandle>();
                 assetHandleCacheDic.Add(key, list);
             }
+
             list.Add(handle);
         }
     }

+ 2 - 59
GameClient/Assets/Game/HotUpdate/UGUI/UGUIManager.cs

@@ -21,65 +21,6 @@ namespace GFGGame
             // 2. 按顺序加载 FairyGUI 包
             try
             {
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Common"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CommonGame"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityAfternoonTea"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityAFuGift"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityDay7"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityGetYuanXiao"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityHuaRongDao"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityMain"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityThemeLuckyBox"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityWanShiLi"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Arena"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Bag"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("BlindBox"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("BornLimit"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Card"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CardSynthetic"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingDecompose"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingFoster"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingShop"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingSynthetic"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingUpgrade"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CreateRole"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("DailyWelfare"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("DeleteAccount"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("DressUp"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("EnduringGiftBox"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Field"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("FieldGuide"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("FieldWork"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Friend"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Guide"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("InstanceZones"));
-                // await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Launcher"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("League"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Loading"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Login"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("LuckyBox"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Mail"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Main"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("MatchingCompetition"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("MiniGame"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("NewYearLogin"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("NewYearRedEnvelope"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Notice"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("OpenServerActivity"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Poem"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("PopWindow"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("RoleInfo"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("RoleLvUp"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Share"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Store"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Studio"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Task"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("TimeTracing"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Travel"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("TurnTable"));
-                await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("XiuFang"));
-
-
                 // 3. 初始化其他逻辑(确保资源已加载)
                 ViewManager.Init();
                 LogController.Instance.Init();
@@ -101,11 +42,13 @@ namespace GFGGame
         {
             var url = LauncherConfig.cfgUrl.Replace("{cfgName}", GameGlobal.cfgName);
             url = url + "?t=" + TimeHelper.ClientNow();
+            Debug.Log($"正在解压数据");
             LauncherView.Instance.SetDesc("正在解压数据...");
             HttpTool.Instance.Get(url, (string data) =>
             {
                 //初始化游戏配置
                 GameConfig.InitData(data);
+                Debug.Log($"初始化游戏配置");
                 //缓存一部分配置文件
                 // FightScoreCfgArray.Instance.Init();
                 // StudioCfgArray.Instance.Init();

+ 7 - 2
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -34,8 +34,10 @@ namespace GFGGame
         protected override void Init()
         {
             base.Init();
+            Debug.Log($"ShowLogin Init");
             packageName = UI_LoginUI.PACKAGE_NAME;
             _ui = UI_LoginUI.Create();
+            Debug.Log($"ShowLogin UI_LoginUI.Create()");
             viewCom = _ui.target;
             isfullScreen = true;
         }
@@ -45,7 +47,7 @@ namespace GFGGame
             base.OnInit();
             _ui.m_txtVersion.text = GameGlobal.version;
 
-
+            Debug.Log($"ShowLogin OnInit");
             _ui.m_btnNotice.onClick.Add(OnClickBtnNotice);
             _ui.m_btnStart.onClick.Add(OnClickBtnStart);
             _ui.m_btnLogout.onClick.Add(OnClickBtnLogout);
@@ -58,6 +60,7 @@ namespace GFGGame
             _ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); });
             _ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); });
             _ui.m_btnAgree.onClick.Add(OnBtnAgreeCklick);
+            Debug.Log($"ShowLogin OnBtnAgreeCklick");
         }
 
         protected override void AddEventListener()
@@ -72,8 +75,9 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+            Debug.Log($"ShowLogin OnShown");
             MusicManager.Instance.PlayCroutine(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
-
+            Debug.Log($"ShowLogin DEFAULT");
             if (_sceneObject == null)
             {
                 PrefabManager.Instance.InstantiateAsync(
@@ -101,6 +105,7 @@ namespace GFGGame
 
         private void ContinueAfterSceneLoad()
         {
+            Debug.Log($"ShowLogin ContinueAfterSceneLoad");
             // SceneController.UpdateLoginScene(_sceneObject);
             ServerInfosComponent serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
             ServerInfo recentlyServerInfo = serverInfosComponent.recentlyServerInfo;

+ 129 - 33
GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs

@@ -15,6 +15,7 @@ namespace GFGGame
         public bool backRefresh;
         public List<String> smallWindow;
     }
+
     /// <summary>
     /// 视图管理类
     /// 管理视图的显示、隐藏
@@ -30,26 +31,80 @@ namespace GFGGame
         private static GComponent _alertLayer;
         private static GComponent _debugLayer;
         private static GComponent _floatLayer;
-        private static bool _nowHideOthers = false;     //正在关闭所有界面的循环中
+        private static bool _nowHideOthers = false; //正在关闭所有界面的循环中
 
         private static Dictionary<string, List<object[]>> _goBackDatas = new Dictionary<string, List<object[]>>();
-       
+
         public static void Clear()
         {
             _viewStack.Clear();
         }
 
-        public static void Init()
+        public static async void Init()
         {
             //设置CustomLoader
             UIObjectFactory.SetLoaderExtension(typeof(GFGGLoader));
             //通用资源,单独加,增加一次引用,不会被释放
-            GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Common"));
-            GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CommonGame"));
-            GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Main"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Login"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Common"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CommonGame"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityAfternoonTea"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityAFuGift"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityDay7"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityGetYuanXiao"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityHuaRongDao"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityMain"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityThemeLuckyBox"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ActivityWanShiLi"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Arena"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Bag"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("BlindBox"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("BornLimit"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Card"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CardSynthetic"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingDecompose"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingFoster"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingShop"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingSynthetic"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("ClothingUpgrade"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("CreateRole"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("DailyWelfare"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("DeleteAccount"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("DressUp"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("EnduringGiftBox"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Field"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("FieldGuide"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("FieldWork"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Friend"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Guide"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("InstanceZones"));
+            // await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Launcher"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("League"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Loading"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("LuckyBox"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Mail"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Main"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("MatchingCompetition"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("MiniGame"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("NewYearLogin"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("NewYearRedEnvelope"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Notice"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("OpenServerActivity"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Poem"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("PopWindow"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("RoleInfo"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("RoleLvUp"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Share"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Store"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Studio"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Task"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("TimeTracing"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Travel"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("TurnTable"));
+            await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("XiuFang"));
             //await GFGUIPackage.AddPackageAsync(ResPathUtil.GetUIPackagePath("Common"));
             UIConfig.buttonSound = (NAudioClip)UIPackage.GetItemAsset("Common", "click");
-       
+
             //统一修改文字字体需要填写路径 ResIn/Font/FZKTJW--GB1-0
             UIConfig.defaultFont = "FZKTJW--GB1-0";
             //默认关闭点击窗口移至顶层的功能,不可打开,如哪个界面需要在界面中单独设置
@@ -86,14 +141,17 @@ namespace GFGGame
         {
             _topLayer.AddChild(gObject);
         }
+
         public static void AddChildToGuideLayer(GObject gObject)
         {
             _guideLayer.AddChild(gObject);
         }
+
         public static void AddChildToModalLayer(GObject gObject)
         {
             _modalLayer.AddChild(gObject);
         }
+
         public static void AddChildToAlertLayer(GObject gObject)
         {
             _alertLayer.AddChild(gObject);
@@ -103,6 +161,7 @@ namespace GFGGame
         {
             _debugLayer.AddChild(gObject);
         }
+
         public static void AddChildToFloatLayer(GObject gObject)
         {
             _floatLayer.AddChild(gObject);
@@ -118,9 +177,9 @@ namespace GFGGame
                 {
                     return GRoot.inst.height * maxAspectRatio;
                 }
+
                 return GRoot.inst.width;
             }
-            
         }
 
         /// <summary>
@@ -131,17 +190,20 @@ namespace GFGGame
         /// <param name="goBackParams">从该视图返回的视图信息</param>
         /// <param name="hideOthers">是否关闭其他视图</param>
         /// <param name="backRefresh">返回上一个界面的时候,上一个界面是否需要刷新界面</param>
-        public static bool Show(string fullViewName, object viewData = null, bool hideOthers = false, bool backRefresh = true,bool isHideToShow = false)
+        public static bool Show(string fullViewName, object viewData = null, bool hideOthers = false,
+            bool backRefresh = true, bool isHideToShow = false)
         {
             string name = GetName(fullViewName);
             if (!GameGlobal.skipCheckOpen && !FunctionOpenDataManager.Instance.CheckIsFunOpenById(name))
             {
                 return false;
             }
+
             if (hideOthers)
             {
                 HideAllView(name);
             }
+
             IUIView obj = null;
 
             if (_viewDic.ContainsKey(name))
@@ -161,18 +223,21 @@ namespace GFGGame
                 view.viewData = viewData;
                 if (!view.isShowing)
                 {
-                    if (isHideToShow && _viewStack.Count > 0){ 
+                    if (isHideToShow && _viewStack.Count > 0)
+                    {
                         view.backRefresh = _viewStack[_viewStack.Count - 1].backRefresh;
                         _viewStack[_viewStack.Count - 1].iUIView = obj;
                     }
                     else
                         view.backRefresh = true;
+
                     view.Show();
                 }
                 else
                 {
                     view.Refresh();
                 }
+
                 LogUtil.LogDev("当前打开:" + name);
             }
 
@@ -182,18 +247,20 @@ namespace GFGGame
             }
 
             //判断是否需要保存界面数据, 会帮助关闭上一个保存界面
-            if (obj.isReturnView && (_viewStack.Count <= 0 || (_viewStack.Count > 0 && _viewStack[_viewStack.Count - 1].name != name)))
+            if (obj.isReturnView && (_viewStack.Count <= 0 ||
+                                     (_viewStack.Count > 0 && _viewStack[_viewStack.Count - 1].name != name)))
             {
                 //保存上一个界面是否需要返回刷新
                 if (!isHideToShow && _viewStack.Count > 1)
                     _viewStack[_viewStack.Count - 1].backRefresh = backRefresh;
-               
+
                 ViewStructure viewStructure = new ViewStructure();
                 viewStructure.name = name;
                 viewStructure.viewData = viewData;
                 viewStructure.iUIView = obj;
                 _viewStack.Add(viewStructure);
-                if (_viewStack.Count > 1 && !hideOthers) {
+                if (_viewStack.Count > 1 && !hideOthers)
+                {
                     if (_viewStack[_viewStack.Count - 2].smallWindow == null)
                         _viewStack[_viewStack.Count - 2].smallWindow = new List<string>();
 
@@ -236,12 +303,15 @@ namespace GFGGame
                         break;
                     _viewStack.RemoveAt(i);
                 }
+
                 return;
             }
-            for (int i = 0; i < count; i++) {
+
+            for (int i = 0; i < count; i++)
+            {
                 if (_viewStack.Count <= 1)
                     break;
-                _viewStack.RemoveAt(_viewStack.Count-1);
+                _viewStack.RemoveAt(_viewStack.Count - 1);
             }
         }
 
@@ -259,10 +329,12 @@ namespace GFGGame
                     if (view.isShowing) return true;
                 }
             }
+
             return false;
         }
 
-        public static bool Show<T>(object viewData = null, bool hideOthers = false, bool backRefresh = true) where T : class, new()
+        public static bool Show<T>(object viewData = null, bool hideOthers = false, bool backRefresh = true)
+            where T : class, new()
         {
             // string[] names = typeof(T).FullName.Split('.');
             // string viewName = names[names.Length - 1];
@@ -274,7 +346,7 @@ namespace GFGGame
         {
             if (_nowHideOthers)
                 return;
-            
+
             if (_viewStack.Count >= 1)
             {
                 bool hasShowingView = false;
@@ -289,6 +361,7 @@ namespace GFGGame
                         break;
                     }
                 }
+
                 ViewStructure viewStructure = _viewStack[_viewStack.Count - 1];
                 if (_viewStack.Count == 1)
                 {
@@ -296,11 +369,13 @@ namespace GFGGame
                     if (!hasShowingView)
                         needShowNextView = true;
                 }
-                else { 
+                else
+                {
                     if (!hasShowingView || (viewStructure.iUIView.isReturnView && viewStructure.name == viewName))
                     {
                         //关闭自己,在队列里去除
-                        if (viewStructure.iUIView.isReturnView && viewStructure.name == viewName) {
+                        if (viewStructure.iUIView.isReturnView && viewStructure.name == viewName)
+                        {
                             backRefresh = viewStructure.backRefresh;
                             _viewStack.RemoveAt(_viewStack.Count - 1);
                         }
@@ -310,11 +385,13 @@ namespace GFGGame
                     }
                 }
 
-                if (needShowNextView) { 
+                if (needShowNextView)
+                {
                     viewStructure = _viewStack[_viewStack.Count - 1];
-                    ViewManager.Show($"GFGGame.{viewStructure.name}", viewStructure.viewData, false, backRefresh,  true);
+                    ViewManager.Show($"GFGGame.{viewStructure.name}", viewStructure.viewData, false, backRefresh, true);
                     //重新打开小弹窗
-                    if (viewStructure.smallWindow != null) { 
+                    if (viewStructure.smallWindow != null)
+                    {
                         foreach (var objName in viewStructure.smallWindow)
                         {
                             ViewManager.Show($"GFGGame.{objName}");
@@ -340,6 +417,7 @@ namespace GFGGame
             {
                 return;
             }
+
             object obj = _viewDic[name];
             if (obj != null)
             {
@@ -368,6 +446,7 @@ namespace GFGGame
                     return;
                 }
             }
+
             MainDataManager.Instance.ViewType = 0;
             ViewManager.Show<MainUIView>(null, true);
         }
@@ -382,6 +461,7 @@ namespace GFGGame
             //}
             return value;
         }
+
         public static IUIView GetUIView(string viewName)
         {
             if (_viewDic.ContainsKey(viewName))
@@ -392,8 +472,10 @@ namespace GFGGame
                     return obj as IUIView;
                 }
             }
+
             return null;
         }
+
         public static void ClearUIView(string viewName)
         {
             if (!string.IsNullOrEmpty(viewName) && _viewDic.ContainsKey(viewName))
@@ -405,19 +487,23 @@ namespace GFGGame
                 }
             }
         }
+
         public static void HideAllView(string excludeViewName = null)
         {
-            for (int i = _viewDic.Keys.Count - 1; i >= 0; i--)//不用foreach是因为:循环过程中可能会触发dispose,导致_viewDic.Keys变化,最终报错
+            for (int i = _viewDic.Keys.Count - 1; i >= 0; i--) //不用foreach是因为:循环过程中可能会触发dispose,导致_viewDic.Keys变化,最终报错
             {
-                int index = i > _viewDic.Keys.Count - 1 ? _viewDic.Keys.Count - 1 : i;//直接去最后一个,不用i是因为关闭一个界面可能会连带关闭其他界面,最终i比_viewDic.Keys.Count大而报错
+                int index = i > _viewDic.Keys.Count - 1
+                    ? _viewDic.Keys.Count - 1
+                    : i; //直接去最后一个,不用i是因为关闭一个界面可能会连带关闭其他界面,最终i比_viewDic.Keys.Count大而报错
                 KeyValuePair<string, IUIView> kv = _viewDic.ElementAt(index);
                 if (kv.Key != excludeViewName)
                 {
-                    if (kv.Key == typeof(FunctionOpenView).Name) continue;//功能开启界面不能强制关闭
+                    if (kv.Key == typeof(FunctionOpenView).Name) continue; //功能开启界面不能强制关闭
                     _nowHideOthers = true;
                     Hide(kv.Key);
                 }
             }
+
             _nowHideOthers = false;
             // _viewDic.Clear();
             // foreach (string viewName in _viewDic.Keys)
@@ -429,15 +515,18 @@ namespace GFGGame
             //     }
             // }
         }
+
         public static void CheckDispose()
         {
-            for (int i = _viewDic.Keys.Count - 1; i >= 0; i--)//不用foreach是因为:循环过程中可能会触发dispose,导致_viewDic.Keys变化,最终报错
+            for (int i = _viewDic.Keys.Count - 1; i >= 0; i--) //不用foreach是因为:循环过程中可能会触发dispose,导致_viewDic.Keys变化,最终报错
             {
-                int index = i > _viewDic.Keys.Count - 1 ? _viewDic.Keys.Count - 1 : i;//直接去最后一个,不用i是因为关闭一个界面可能会连带关闭其他界面,最终i比_viewDic.Keys.Count大而报错
+                int index = i > _viewDic.Keys.Count - 1
+                    ? _viewDic.Keys.Count - 1
+                    : i; //直接去最后一个,不用i是因为关闭一个界面可能会连带关闭其他界面,最终i比_viewDic.Keys.Count大而报错
                 KeyValuePair<string, IUIView> kv = _viewDic.ElementAt(index);
                 if (kv.Value.isShowing == true) continue;
                 // if (kv.Value.packageName == ResPathUtil.GetUIPackagePath("CommonGame") || kv.Value.packageName == ResPathUtil.GetUIPackagePath("Common") || kv.Value.packageName == ResPathUtil.GetUIPackagePath("Main")) return;//这几个包不释放
-                if(_viewDic.Keys.Count <= 10) return;  //打开界面小于10个就不销毁了
+                if (_viewDic.Keys.Count <= 10) return; //打开界面小于10个就不销毁了
                 long currentTime = TimeHelper.ClientNowSeconds();
                 long closeTime = kv.Value.closeTime;
                 if (closeTime > 0 && currentTime - closeTime >= TimeUtil.SECOND_PER_MUNITE * 1)
@@ -447,6 +536,7 @@ namespace GFGGame
                 }
             }
         }
+
         private static object CreateViewInstance(string name)
         {
             //LogUtil.LogFormatDev("CreateViewInstance {0}", name);
@@ -455,6 +545,7 @@ namespace GFGGame
             {
                 return Activator.CreateInstance(type);
             }
+
             return null;
         }
 
@@ -467,6 +558,7 @@ namespace GFGGame
             layer.AddRelation(GRoot.inst, RelationType.Size);
             return layer;
         }
+
         public static bool CheckIsTopView(GComponent viewCom)
         {
             if (ViewManager.isViewOpen(typeof(GuideView).Name)) return false;
@@ -478,12 +570,15 @@ namespace GFGGame
                     return true;
                 }
             }
+
             if (GRoot.inst.GetTopWindow() == viewCom)
             {
                 return true;
             }
+
             return false;
         }
+
         public static string GetName(string fullName)
         {
             string[] names = fullName.Split('.');
@@ -494,14 +589,14 @@ namespace GFGGame
         public static void SetMaskAlpha(float alpha)
         {
             GRoot.inst.modalLayer.alpha = alpha;
-
         }
 
         /// <summary>
         /// 任务界面跳转
         /// </summary>
         /// <param name="jumpId"></param>
-        public static void JumpToView(string jumpId, object[] param, bool hideOther = false, bool backRefresh = true, Action onSuccess = null)
+        public static void JumpToView(string jumpId, object[] param, bool hideOther = false, bool backRefresh = true,
+            Action onSuccess = null)
         {
             switch (jumpId)
             {
@@ -529,6 +624,7 @@ namespace GFGGame
                     {
                         ViewManager.Show<LeagueJoinView>(null, hideOther, backRefresh);
                     }
+
                     break;
                 case nameof(StoreView):
                     ViewManager.Show<StoreView>(param, hideOther, backRefresh);
@@ -546,7 +642,7 @@ namespace GFGGame
                     ViewManager.Show<ClothingSyntheticView>(param, hideOther, backRefresh);
                     break;
                 case nameof(LuckyBoxView):
-                    if(param.Length > 0)
+                    if (param.Length > 0)
                         ViewManager.Show<LuckyBoxView>(param[0], hideOther, backRefresh);
                     else
                         ViewManager.Show<LuckyBoxView>(null, hideOther, backRefresh);
@@ -555,8 +651,8 @@ namespace GFGGame
                     ViewManager.Show($"GFGGame.{jumpId}", null, hideOther, backRefresh);
                     break;
             }
+
             onSuccess?.Invoke();
         }
-
     }
-}
+}