1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace KYFramework
- {
- public static class Game
- {
- private static EventSystem eventSystem;
- public static EventSystem EventSystem
- {
- get
- {
- return eventSystem ?? (eventSystem = new EventSystem());
- }
- }
- private static Scene scene;
- public static Scene Scene
- {
- get
- {
- if (scene != null)
- {
- return scene;
- }
- scene = new Scene() { Name = "ClientM" };
- return scene;
- }
- }
- private static ObjectPool objectPool;
- public static ObjectPool ObjectPool
- {
- get
- {
- if (objectPool != null)
- {
- return objectPool;
- }
- objectPool = new ObjectPool();
- return objectPool;
- }
- }
- public static void Close()
- {
- scene?.Dispose();
- scene = null;
- objectPool?.Dispose();
- objectPool = null;
- eventSystem = null;
- }
- }
- }
|