GameLauncher.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using UnityEngine;
  2. using GFGGame;
  3. using ET;
  4. using System.Threading;
  5. public class GameLauncher : MonoBehaviour
  6. {
  7. private void Awake()
  8. {
  9. Application.runInBackground = true;
  10. //ET
  11. System.AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
  12. {
  13. Log.Error(e.ExceptionObject.ToString());
  14. };
  15. SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
  16. DontDestroyOnLoad(gameObject);
  17. ETTask.ExceptionHandler += Log.Error;
  18. Log.ILog = new UnityLogger();
  19. Options.Instance = new Options();
  20. TimeInfo.Instance.TimeZone = 8;
  21. }
  22. // Start is called before the first frame update
  23. void Start()
  24. {
  25. LogServerHelperHttp.SendNodeLog((int)LogNode.OnStart);
  26. LauncherConfig.Init();
  27. Debug.LogFormat("Application.version {0}", Application.version);
  28. FGUILauncher.Init();
  29. LauncherView.Instance.Open();
  30. LauncherView.Instance.SetDesc("正在初始化...");
  31. LauncherConfig.GetLauncherCfg();
  32. }
  33. }