Beispiel #1
0
        /// <summary>
        /// Resets the current level.
        /// </summary>
        public void ResetLevel()
        {
            SetScore(0);
            _scoreCounter.ResetCounter();
            _ui.ActivateLevelEndScreen(false);
            World.Instance.ResetWorld();
            _levelManager.ResetLevel();
            _input.ResetInput();
            _players.ForEach(pc => pc.CancelActions());
            _players.ForEach
                (pc => pc.RespawnPosition = _levelManager.GetSpawnPoint(pc.ID));
            ForEachActivePlayerChar(pc => pc.Respawn());
            _npcs.ForEach(npc => npc.Respawn());
            _levelObjects.ForEach(obj => obj.ResetObject());
            _ui.ResetUI();
            DeadPlayerCount = 0;
            _fade.StartFadeIn(true);

            if (GameState == State.Play || GameState == State.LevelEnd)
            {
                StartLevel();
            }
        }