Ejemplo n.º 1
0
        protected void OnAwake(LevelType levelType)
        {
            new GameLogHandler();

            this.levelType = levelType;

            PersistanceManager.Get().Init();
            StartLevelManager.Get().Init();
            if (levelType == LevelType.STARTMENU)
            {
                GameInputManager.Get().Init(CursorLockMode.Confined);
            }
            else
            {
                GameInputManager.Get().Init(CursorLockMode.Locked);
            }

            LevelAvailabilityManager.Get().Init();
            LevelAvailabilityTimelineManager.Get().Init();
            LevelManager.Get().Init(levelType);

            if (this.levelType != LevelType.STARTMENU)
            {
                LevelChunkFXTransitionManager.Get().Init();
                CoreGameSingletonInstances.Coroutiner.StartCoroutine(InitializeTimelinesAtEndOfFrame());
            }
        }
Ejemplo n.º 2
0
        protected void OnAwake(LevelType levelType)
        {
            new GameLogHandler();

            this.levelType = levelType;
            this._simulatePhysicsTimeSteps = new SimulatePhysicsTimeSteps(this.ManuallyUpdatePhysicsWorld);

            PersistanceManager.Get().Init();
            StartLevelManager.Get().Init();
            if (levelType == LevelType.STARTMENU)
            {
                GameInputManager.Get().Init(CursorLockMode.Confined);
                Cursor.visible = true;
            }
            else
            {
                GameInputManager.Get().Init(CursorLockMode.Locked);
                Cursor.visible = false;
            }

            LevelAvailabilityManager.Get().Init();
            LevelAvailabilityTimelineManager.Get().Init();
            LevelManager.Get().Init(levelType);

            if (this.levelType != LevelType.STARTMENU)
            {
                LevelChunkFXTransitionManager.Get().Init();
                CoreGameSingletonInstances.Coroutiner.StartCoroutine(InitializeTimelinesAtEndOfFrame());
            }
        }
Ejemplo n.º 3
0
        public static void Init()
        {
            var startLevelManager            = StartLevelManager.Get();
            var StartMenuPrefabConfiguration = StartMenuSingletonInstances.StartMenuStaticConfigurationManager.StartMenuStaticConfiguration.StartMenuPrefabConfiguration;
            var StartMenuCanvas = CoreGameSingletonInstances.GameCanvas;

            IGameProgressionStateManagerDataRetriever IGameProgressionStateManagerDataRetriever = StartMenuSingletonInstances.GameProgressionStateManager;

            var NewGameButton = MonoBehaviour.Instantiate(StartMenuPrefabConfiguration.StartMenuButtonBasePrefab, StartMenuCanvas.transform);

            NewGameButton.GetComponentInChildren <Text>().text        = "New Game";
            ((RectTransform)NewGameButton.transform).anchoredPosition = new Vector2(0, 40);

            NewGameButton.onClick.AddListener(() =>
            {
                //Destroy all saved data
                var persistanceDirectory = new DirectoryInfo(Application.persistentDataPath);
                foreach (var directory in persistanceDirectory.GetDirectories())
                {
                    directory.Delete(true);
                }

                LevelTransitionManager.Get().OnStartMenuToLevel(LevelManagementConfigurationGameObject.Get().GlobalLevelConfiguration.NewGameStartLevelID);
            });

            var ContinueButton = MonoBehaviour.Instantiate(StartMenuPrefabConfiguration.StartMenuButtonBasePrefab, StartMenuCanvas.transform);

            ContinueButton.GetComponentInChildren <Text>().text        = "Continue";
            ((RectTransform)ContinueButton.transform).anchoredPosition = new Vector2(0, -40);
            ContinueButton.interactable = IGameProgressionStateManagerDataRetriever.HasAlreadyPlayed();
            if (ContinueButton.IsInteractable())
            {
                ContinueButton.onClick.AddListener(() => { LevelTransitionManager.Get().OnStartMenuToLevel(startLevelManager.GetStartLevelID()); });
            }
        }
Ejemplo n.º 4
0
        private void Start()
        {
            this.GetComponent <Button>().onClick.AddListener(() =>
            {
                //Destroy all saved data
                var persistanceDirectory = new DirectoryInfo(Application.persistentDataPath);
                foreach (var directory in persistanceDirectory.GetDirectories())
                {
                    directory.Delete(true);
                }

                LevelTransitionManager.Get().OnStartMenuToLevel(StartLevelManager.Get().GetStartLevelID());
            });
        }