private void OnWorldSelected(WorldButton button)
        {
            SceneGlobalState.WorldScrollOffset = ScrollOffset;
            var transition = new LevelSelectController.TransitionData(button.World);

            TransitionManager.TransferToLevelSelect(transition);
        }
Exemple #2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            _world = (WorldType)EditorGUILayout.IntField("world", (int)_world);
            _level = (Level)EditorGUILayout.IntField("level", (int)_level);

            if (GUILayout.Button(_difficulty.ToString()))
            {
                _difficulty = _difficulty == Difficulty.Easy
                                        ? Difficulty.Hard : Difficulty.Easy;
            }

            if (!Application.isPlaying)
            {
                return;
            }

            if (Target.IsLoaded)
            {
                return;
            }

            if (GUILayout.Button("generate"))
            {
                Target.Load(LevelDef);
            }

            if (GUILayout.Button("reload"))
            {
                TransitionManager.TransferToLevel(LevelDef);
            }
        }
        private static void OnEscapeKeyDown()
        {
            var transition = new MainMenuController.TransitionData()
            {
                State = MainMenuController.State.Play
            };

            TransitionManager.TransferToMainMenu(transition);
        }
Exemple #4
0
        public void OnDifficultySelected(Difficulty difficulty)
        {
            if (!_selectedButton)
            {
                return;
            }

            var def = new LevelDef(World, _selectedButton.Level, difficulty);

            TransitionManager.TransferToLevel(def);
        }
        private void Win()
        {
            Debug.Assert(_starsLeft.Count == 0);

            UnregisterGetStar();

            UserLevelClear.Win(_levelDef);

            var nextLevel = _levelDef.Next();

            if (nextLevel.HasValue)
            {
                TransitionManager.TransferToLevel(nextLevel.Value);
            }
            else
            {
                TransitionManager.TransferToLevelSelect(new LevelSelectController.TransitionData(_levelDef.World));
            }
        }
Exemple #6
0
        public void OnEscapeKeyDown()
        {
            var data = new WorldSelectController.TransitionData();

            TransitionManager.TransferToWorldSelect(data);
        }
        void OnEscapeKeyDown()
        {
            var transition = new LevelSelectController.TransitionData(_levelDef.World);

            TransitionManager.TransferToLevelSelect(transition);
        }
 private void Lose()
 {
     UnregisterGetStar();
     TransitionManager.TransferToLevel(_levelDef);
 }
 public void TransferToWorldSelect()
 {
     TransitionManager.TransferToWorldSelect(new WorldSelectController.TransitionData());
 }