HotUpdateEntry.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Assets.Game.Launcher.HotUpdateProxy;
  2. using ET;
  3. using FairyGUI;
  4. using System;
  5. using System.Threading;
  6. using UnityEngine;
  7. namespace GFGGame.HotUpdate
  8. {
  9. public class HotUpdateEntry
  10. {
  11. public static void Start()
  12. {
  13. VEngine.Logger.Loggable = false;
  14. //ET
  15. System.AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
  16. {
  17. Log.Error(e.ExceptionObject.ToString());
  18. };
  19. SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
  20. LitJson.UnityTypeBindings.Register();
  21. ETTask.ExceptionHandler += Log.Error;
  22. Log.ILog = new UnityLogger();
  23. Options.Instance = new Options();
  24. TimeInfo.Instance.TimeZone = 8;
  25. try
  26. {
  27. HotUpdateProxy.Instance.update = Game.Update;
  28. HotUpdateProxy.Instance.lateUpdate = Game.LateUpdate;
  29. HotUpdateProxy.Instance.onApplicationQuit = Game.Close;
  30. Game.EventSystem.Add(HotUpdateCodeLoader.Instance.GetTypes());
  31. Game.EventSystem.Publish(new ET.EventType.AppStart());
  32. }
  33. catch (Exception e)
  34. {
  35. Log.Error(e);
  36. }
  37. GameController.Start();
  38. }
  39. }
  40. }