HotUpdateDriver.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using GFGGame.Launcher;
  2. using System.Collections;
  3. using UniFramework.Pooling;
  4. using UnityEngine;
  5. using YooAsset;
  6. namespace GFGGame
  7. {
  8. public class HotUpdateDriver: MonoBehaviour
  9. {
  10. private void Awake()
  11. {
  12. Debug.Log(1111111.ToString());
  13. //UniFramework
  14. // 初始化对象池系统
  15. UniPooling.Initalize();
  16. //Litjson
  17. LitJson.UnityTypeBindings.Register();
  18. //ET
  19. ETManager.Instance.Init();
  20. //Game
  21. OperationSystem.Initialize();
  22. GameController.Start();
  23. Reporter reporter = GameObject.Find("Reporter").GetComponent<Reporter>();
  24. if ((LauncherConfig.ChannelId != (int)ChannelID.Test &&
  25. LauncherConfig.ChannelId != (int)ChannelID.DouYouTest) && reporter != null)
  26. {
  27. reporter.numOfCircleToShow = 5;
  28. }
  29. }
  30. private void Update()
  31. {
  32. OperationSystem.Update();
  33. CheckExitAlert();
  34. }
  35. private void OnDestroy()
  36. {
  37. OperationSystem.DestroyAll();
  38. }
  39. private void OnApplicationQuit()
  40. {
  41. SQLiteHelper.Instance.CloseConnection(true);
  42. }
  43. private void CheckExitAlert()
  44. {
  45. if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home))
  46. {
  47. QDManager.Exit();
  48. }
  49. }
  50. private void OnApplicationPause(bool pause)
  51. {
  52. if(pause)
  53. {
  54. GameGlobal.pauseTime = ET.TimeHelper.ClientNowSeconds();
  55. }
  56. }
  57. }
  58. }