Ejemplo n.º 1
0
        protected override void Init()
        {
            FastYield.CreateSingleton();
            LogToFile.CreateSingleton();
            GameStateMachine.CreateSingleton();

            // AssetBundleManager.CreateSingleton();
            UiManager.CreateSingleton();

            GameStateMachine.Instance.RegisterGameState("TestState", new TestState());
            GameStateMachine.Instance.ChangeState("TestState");
        }
Ejemplo n.º 2
0
        private void Awake()
        {
            var messageBroker        = new MessageBrokerService();
            var timeService          = new TimeService();
            var dataService          = new DataService();
            var configsProvider      = new ConfigsProvider();
            var uiService            = new GameUiService(new UiAssetLoader());
            var worldObjectReference = new WorldObjectReferenceService(_inputSystem, _mainCamera);
            var gameLogic            = new GameLogic(messageBroker, timeService, dataService, configsProvider);
            var gameServices         = new GameServices(messageBroker, timeService, dataService, gameLogic, worldObjectReference);

            MainInstaller.Bind <IGameDataProvider>(gameLogic);
            MainInstaller.Bind <IGameServices>(gameServices);

            _stateMachine = new GameStateMachine(gameLogic, gameServices, uiService, configsProvider, dataService);
        }
Ejemplo n.º 3
0
        protected override void Init()
        {
            // Framework
            FastYield.CreateSingleton();
            LogToFile.CreateSingleton();
            GameStateMachine.CreateSingleton();
            ConfigManager.CreateSingleton();
            RegisterAllConfig();
            ConfigManager.Instance.FinishInit();
            AssetBundleManagerInitOption.CreateSingleton();
            // 需要在编辑器使用AssetBundle的把下面改成true
            AssetBundleManagerInitOption.Instance.UseAssetBundle = false;
            AssetBundleManager.CreateSingleton();
            UiManager.CreateSingleton();
            RegisterAllCanvases();
            Scheduler.CreateSingleton();

            GameStateMachine.Instance.RegisterGameState(new TestState());
            GameStateMachine.Instance.ChangeState(typeof(TestState));
        }
Ejemplo n.º 4
0
 private void OnApplicationQuit()
 {
     GameStateMachine.DestroySingleton();
     LogToFile.DestroySingleton();
     FastYield.DestroySingleton();
 }