guodong před 3 roky
rodič
revize
0ac3d50851

+ 2 - 1
GameClient/Assets/Game/Launcher/GameLauncher.cs

@@ -29,11 +29,12 @@ public class GameLauncher : MonoBehaviour
     // Start is called before the first frame update
     void Start()
     {
+        LauncherConfig.Init();
         Debug.LogFormat("Application.version {0}", Application.version);
         FGUILauncher.Init();
         LauncherView.Instance.Open();
         LauncherView.Instance.SetDesc("正在初始化...");
-        LauncherConfig.Init();
+        LauncherConfig.GetPlatformCfg();
     }
 
 

+ 11 - 5
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -8,6 +8,7 @@ namespace GFGGame
     {
         public enum EnumNetType { DEV, LOCAL, TEMP }
         public static EnumNetType netType = EnumNetType.LOCAL;
+        public static string cfgName;
         public const int HTTP_GET_TIME_OUT = 3;
         public const int HTTP_POST_TIME_OUT = 15;
         public static string SOUND_KEY = "sound";
@@ -27,24 +28,29 @@ namespace GFGGame
 #if PT_DEV
             //ÍâÍødev°æ±¾
             netType = EnumNetType.DEV;
-            string cfgName = "cfg_dev";
+            cfgName = "cfg_dev";
 #elif PT_TEMP
             netType = EnumNetType.TEMP;
-            string cfgName = "cfg_temp";
+            cfgName = "cfg_temp";
             VEngine.Utility.buildPath = "Bundles_temp";
 #else
             netType = EnumNetType.LOCAL;
-            string cfgName = "cfg_local";
+            cfgName = "cfg_local";
 #endif
 
+            //Debug.Log($"loginApiUrl {loginApiUrl} netType {netType}");
+        }
+
+        public static void GetPlatformCfg()
+        {
             string url = $"http://39.99.144.134/res/platform/{cfgName}.json";
-            
+
             HttpTool.Instance.Get(url, "", (string data) => {
                 ResultHandler(data);
             });
-            Debug.Log($"loginApiUrl {loginApiUrl} netType {netType}");
         }
 
+
         private static void ResultHandler(string data)
         {
             var result = JsonMapper.ToObject<Result>(data);

+ 1 - 1
GameClient/Assets/Game/Launcher/Views/LauncherView.cs

@@ -54,7 +54,6 @@ namespace GFGGame
             _ui.target.MakeFullScreen();
             _ui.target.AddRelation(GRoot.inst, RelationType.Size);
             _ui.m_txtVersion.text = Application.version;
-            _ui.m_imgLogo.visible = LauncherConfig.netType != LauncherConfig.EnumNetType.TEMP;
         }
 
         /// <summary>
@@ -137,6 +136,7 @@ namespace GFGGame
             _ui.m_txtDescRight.text = "";
             GRoot.inst.AddChild(_ui.target);
             isOpen = true;
+            _ui.m_imgLogo.visible = LauncherConfig.netType != LauncherConfig.EnumNetType.TEMP;
         }
 
         /// <summary>