using UnityEngine; using GFGGame; using ET; using System.Threading; public class GameLauncher : MonoBehaviour { private void Awake() { Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.runInBackground = true; //ET System.AppDomain.CurrentDomain.UnhandledException += (sender, e) => { Log.Error(e.ExceptionObject.ToString()); }; SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance); DontDestroyOnLoad(gameObject); ETTask.ExceptionHandler += Log.Error; Log.ILog = new UnityLogger(); Options.Instance = new Options(); TimeInfo.Instance.TimeZone = 8; } // 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.GetLauncherCfg(); } }