|
@@ -3,6 +3,7 @@ using GFGGame;
|
|
using ET;
|
|
using ET;
|
|
using System.Threading;
|
|
using System.Threading;
|
|
using GFGGame.Launcher;
|
|
using GFGGame.Launcher;
|
|
|
|
+using FairyGUI;
|
|
|
|
|
|
public class GameLauncher : MonoBehaviour
|
|
public class GameLauncher : MonoBehaviour
|
|
{
|
|
{
|
|
@@ -36,8 +37,14 @@ public class GameLauncher : MonoBehaviour
|
|
Application.runInBackground = true;
|
|
Application.runInBackground = true;
|
|
LauncherConfig.InitScriptCompilation();
|
|
LauncherConfig.InitScriptCompilation();
|
|
FGUILauncher.Init();
|
|
FGUILauncher.Init();
|
|
- LauncherView.Instance.Open();
|
|
|
|
- InitLauncherCfg();
|
|
|
|
|
|
+ HealthAdviceView.Instance.Open();
|
|
|
|
+ int time = LauncherConfig.netType == LauncherConfig.EnumNetType.LOCAL ? 3 : 10;
|
|
|
|
+ Timers.inst.Add(time, 1, (object param) =>
|
|
|
|
+ {
|
|
|
|
+ HealthAdviceView.Instance.Close();
|
|
|
|
+ LauncherView.Instance.Open();
|
|
|
|
+ InitLauncherCfg();
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -47,7 +54,7 @@ public class GameLauncher : MonoBehaviour
|
|
{
|
|
{
|
|
LauncherView.Instance.SetDesc("正在初始化..");
|
|
LauncherView.Instance.SetDesc("正在初始化..");
|
|
var url = LauncherConfig.cfgUrl.Replace("{cfgName}", LauncherConfig.cfgName);
|
|
var url = LauncherConfig.cfgUrl.Replace("{cfgName}", LauncherConfig.cfgName);
|
|
- url = url + "?t=" + TimeHelper.ClientNow();
|
|
|
|
|
|
+ url = url + "?t=" + TimeHelper.ClientNow();
|
|
HttpTool.Instance.Get(url, (string json) =>
|
|
HttpTool.Instance.Get(url, (string json) =>
|
|
{
|
|
{
|
|
LauncherConfig.InitPlatform(json);
|
|
LauncherConfig.InitPlatform(json);
|
|
@@ -60,10 +67,11 @@ public class GameLauncher : MonoBehaviour
|
|
|
|
|
|
public void CheckGameStatus()
|
|
public void CheckGameStatus()
|
|
{
|
|
{
|
|
- if(LauncherConfig.serverStatus == 1)
|
|
|
|
|
|
+ if (LauncherConfig.serverStatus == 1)
|
|
{
|
|
{
|
|
Alert.Show("游戏正在维护中,请稍后再试。")
|
|
Alert.Show("游戏正在维护中,请稍后再试。")
|
|
- .SetLeftButton(true, "知道了", (data) => {
|
|
|
|
|
|
+ .SetLeftButton(true, "知道了", (data) =>
|
|
|
|
+ {
|
|
|
|
|
|
Application.Quit();
|
|
Application.Quit();
|
|
});
|
|
});
|
|
@@ -92,7 +100,8 @@ public class GameLauncher : MonoBehaviour
|
|
private void DownloadApk()
|
|
private void DownloadApk()
|
|
{
|
|
{
|
|
Alert.Show("需要安装新的安装包,请联系研发获取。")
|
|
Alert.Show("需要安装新的安装包,请联系研发获取。")
|
|
- .SetLeftButton(true, "知道了", (data) => {
|
|
|
|
|
|
+ .SetLeftButton(true, "知道了", (data) =>
|
|
|
|
+ {
|
|
|
|
|
|
Application.Quit();
|
|
Application.Quit();
|
|
});
|
|
});
|