HotUpdateEntry.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. //Reporter
  14. GameObject.Find("Reporter").GetComponent<Reporter>().numOfCircleToShow = 7;
  15. //版本日志
  16. VEngine.Logger.Loggable = false;
  17. //ET
  18. System.AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
  19. {
  20. Log.Error(e.ExceptionObject.ToString());
  21. };
  22. SynchronizationContext.SetSynchronizationContext(ThreadSynchronizationContext.Instance);
  23. LitJson.UnityTypeBindings.Register();
  24. ETTask.ExceptionHandler += Log.Error;
  25. Log.ILog = new UnityLogger();
  26. Options.Instance = new Options();
  27. TimeInfo.Instance.TimeZone = 8;
  28. try
  29. {
  30. HotUpdateProxy.Instance.update = Game.Update;
  31. HotUpdateProxy.Instance.lateUpdate = Game.LateUpdate;
  32. //退出进程被杀掉了,暂不执行
  33. //HotUpdateProxy.Instance.onApplicationQuit = Game.Close;
  34. Game.EventSystem.Add(HotUpdateCodeLoader.Instance.GetTypes());
  35. Game.EventSystem.Publish(new ET.EventType.AppStart());
  36. }
  37. catch (Exception e)
  38. {
  39. Log.Error(e);
  40. }
  41. GameController.Start();
  42. }
  43. }
  44. }