瀏覽代碼

添加更新链接

guodong 1 年之前
父節點
當前提交
411f30dcb6

+ 3 - 0
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -40,6 +40,7 @@ namespace GFGGame
         public static string updateAppPrompt;
         public static string updateResPrompt;
         public static int promptSizeMB;
+        public static string updateUrl;
 
         public static void InitScriptCompilation()
         {
@@ -95,6 +96,7 @@ namespace GFGGame
             LauncherConfig.statusPrompt = result.statusPrompt;
             LauncherConfig.updateAppPrompt = result.updateAppPrompt;
             LauncherConfig.updateResPrompt = result.updateResPrompt;
+            LauncherConfig.updateUrl = result.updateUrl;
             if(!string.IsNullOrEmpty(result.promptSizeMB))
             {
                 LauncherConfig.promptSizeMB = int.Parse(result.promptSizeMB);
@@ -114,6 +116,7 @@ namespace GFGGame
             public string updateAppPrompt;
             public string updateResPrompt;
             public string promptSizeMB;
+            public string updateUrl;
         }
 
     }

+ 22 - 7
GameClient/Assets/Game/Launcher/Platform/QDManagerInit.cs

@@ -22,16 +22,31 @@ namespace GFGGame.Launcher
             switch(LauncherConfig.ChannelId)
             {
                 default:
-                    if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
+                    if(!string.IsNullOrEmpty(LauncherConfig.updateUrl))
                     {
-                        LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
+                        if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
+                        {
+                            LauncherConfig.updateAppPrompt = "需要安装新的安装包。";
+                        }
+                        Alert.Show(LauncherConfig.updateAppPrompt)
+                                .SetLeftButton(true, "前往更新", (data) =>
+                                {
+                                    Application.OpenURL(LauncherConfig.updateUrl);
+                                });
                     }
-                    Alert.Show(LauncherConfig.updateAppPrompt)
-                            .SetLeftButton(true, "知道了", (data) =>
-                            {
+                    else
+                    {
+                        if (string.IsNullOrEmpty(LauncherConfig.updateAppPrompt))
+                        {
+                            LauncherConfig.updateAppPrompt = "需要安装新的安装包,请联系研发获取。";
+                        }
+                        Alert.Show(LauncherConfig.updateAppPrompt)
+                                .SetLeftButton(true, "知道了", (data) =>
+                                {
 
-                                Application.Quit();
-                            });
+                                    Application.Quit();
+                                });
+                    }
                     break;
             }
         }