GameLauncher.cs 1023 B

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