Game.cs 346 B

123456789101112131415161718192021222324252627
  1. namespace Base
  2. {
  3. public sealed class Game
  4. {
  5. private static Entity game;
  6. public static Entity Scene
  7. {
  8. get
  9. {
  10. if (game == null)
  11. {
  12. game = new Entity();
  13. game.AddComponent<Scene>();
  14. }
  15. return game;
  16. }
  17. }
  18. public static void Close()
  19. {
  20. Entity scene = game;
  21. game = null;
  22. scene.Dispose();
  23. }
  24. }
  25. }