GameLauncher.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. Application.runInBackground = true;
  12. //ET
  13. System.AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
  14. {
  15. Log.Error(e.ExceptionObject.ToString());
  16. };
  17. SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
  18. DontDestroyOnLoad(gameObject);
  19. ETTask.ExceptionHandler += Log.Error;
  20. Log.ILog = new UnityLogger();
  21. Options.Instance = new Options();
  22. TimeInfo.Instance.TimeZone = 8;
  23. }
  24. // Start is called before the first frame update
  25. void Start()
  26. {
  27. LauncherConfig.Init();
  28. Debug.LogFormat("Application.version {0}", Application.version);
  29. FGUILauncher.Init();
  30. LauncherView.Instance.Open();
  31. LauncherView.Instance.SetDesc("正在初始化...");
  32. LauncherConfig.GetPlatformCfg();
  33. }
  34. }