Ejemplo n.º 1
0
        private void Awake()
        {
            if (_instance != null && _instance != this)
            {
                Destroy(gameObject);
                return;
            }

            if (_instance == this)
            {
                return;
            }

            _instance = this;
            _settingsManager.LoadPlayerSettings();
            _settingsManager.OnSettingsChanged += settingsManager => ApplyPlayerSettings();

            DataManager.RegisterDataStore(new UnityDataStore());
            ContentManager.RegisterContentStore(new UnityContentStore());

            LevelManager.LoadLevelPacks();

            // Deactivate all game controllers
            TutorialController.DisableController();
            GameController.DisableController();
            SetGameController(GameController);

            SetupObjectPools();
            _levelContainer = new GameObject("Level Container");
            _levelContainer.transform.parent = MainGameContainer.transform;

            ApplyPlayerSettings();
        }