Game.cs 595 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace ETModel
  2. {
  3. public static class Game
  4. {
  5. public static Scene Scene { get; set; }
  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 ObjectPool objectPool;
  15. public static ObjectPool ObjectPool
  16. {
  17. get
  18. {
  19. return objectPool ?? (objectPool = new ObjectPool());
  20. }
  21. }
  22. public static Options Options;
  23. public static void Close()
  24. {
  25. Scene.Dispose();
  26. Scene = null;
  27. objectPool = null;
  28. eventSystem = null;
  29. }
  30. }
  31. }