HotUpdateDriver.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 && reporter != null)
  25. {
  26. reporter.numOfCircleToShow = 50;
  27. }
  28. }
  29. private void Update()
  30. {
  31. OperationSystem.Update();
  32. CheckExitAlert();
  33. }
  34. private void OnDestroy()
  35. {
  36. OperationSystem.DestroyAll();
  37. }
  38. private void OnApplicationQuit()
  39. {
  40. SQLiteHelper.Instance.CloseConnection(true);
  41. }
  42. private void CheckExitAlert()
  43. {
  44. if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home))
  45. {
  46. QDManager.Exit();
  47. }
  48. }
  49. private void OnApplicationPause(bool pause)
  50. {
  51. if(pause)
  52. {
  53. GameGlobal.pauseTime = ET.TimeHelper.ClientNowSeconds();
  54. }
  55. }
  56. }
  57. }