TransferToLevel() public static method

public static TransferToLevel ( LevelDef def ) : void
def LevelDef
return void
Esempio n. 1
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);
            }
        }
Esempio n. 2
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));
            }
        }
 private void Lose()
 {
     UnregisterGetStar();
     TransitionManager.TransferToLevel(_levelDef);
 }