HotUpdateEntry.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. //退出进程被杀掉了,暂不执行
  30. //HotUpdateProxy.Instance.onApplicationQuit = Game.Close;
  31. Game.EventSystem.Add(HotUpdateCodeLoader.Instance.GetTypes());
  32. Game.EventSystem.Publish(new ET.EventType.AppStart());
  33. }
  34. catch (Exception e)
  35. {
  36. Log.Error(e);
  37. }
  38. GameController.Start();
  39. }
  40. }
  41. }