HotUpdateDriver.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using UniFramework.Pooling;
  2. using UnityEngine;
  3. namespace GFGGame
  4. {
  5. public class HotUpdateDriver: MonoBehaviour
  6. {
  7. private void Awake()
  8. {
  9. //UniFramework
  10. // 初始化对象池系统
  11. UniPooling.Initalize();
  12. //Litjson
  13. LitJson.UnityTypeBindings.Register();
  14. //ET
  15. ETManager.Instance.Init();
  16. //Game
  17. OperationSystem.Initialize();
  18. GameController.Start();
  19. }
  20. private void Update()
  21. {
  22. OperationSystem.Update();
  23. CheckExitAlert();
  24. }
  25. private void OnDestroy()
  26. {
  27. OperationSystem.DestroyAll();
  28. }
  29. private void OnApplicationQuit()
  30. {
  31. SQLiteHelper.Instance.CloseConnection(true);
  32. }
  33. private void CheckExitAlert()
  34. {
  35. if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Home))
  36. {
  37. QDManager.Exit();
  38. }
  39. }
  40. }
  41. }