Game.cs 844 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using UnityEngine;
  2. namespace ETHotfix
  3. {
  4. public static class Game
  5. {
  6. private static EventSystem eventSystem;
  7. public static EventSystem EventSystem
  8. {
  9. get
  10. {
  11. return eventSystem ?? (eventSystem = new EventSystem());
  12. }
  13. }
  14. private static Scene scene;
  15. public static Scene Scene
  16. {
  17. get
  18. {
  19. if (scene != null)
  20. {
  21. return scene;
  22. }
  23. scene = new Scene() { Name = "ClientH" };
  24. return scene;
  25. }
  26. }
  27. private static ObjectPool objectPool;
  28. public static ObjectPool ObjectPool
  29. {
  30. get
  31. {
  32. if (objectPool != null)
  33. {
  34. return objectPool;
  35. }
  36. objectPool = new ObjectPool() { Name = "ClientH" };
  37. return objectPool;
  38. }
  39. }
  40. public static void Close()
  41. {
  42. scene.Dispose();
  43. scene = null;
  44. eventSystem = null;
  45. objectPool.Dispose();
  46. objectPool = null;
  47. }
  48. }
  49. }