Hotfix.cs 691 B

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