Ejemplo n.º 1
0
        private void OnNewScoreReached(int score)
        {
            var levelSettings = GetMatchingPreset(score);

            if (_currentPreset.Id != levelSettings.Id)
            {
                _currentPreset = levelSettings;
                ReloadLevelSettings(_currentPreset);
            }
        }
Ejemplo n.º 2
0
        private void ReloadLevelSettings(ChunkPresets preset)
        {
            _maxChunksWithoutAmmoRefill = preset.MaxChunksWithoutAmmoRefill;
            _chunkSchemes          = preset.Chunks;
            _ammoRefillProbability = preset.AmmoRefillProbability;
            _jetpackProbability    = preset.JetpackProbability;
            _gapBetweenChunks      = preset.GapBetweenChunks;

            _schemeQueue.Clear();
            _shuffledSchemes.Clear();

            FillListWithChunks();
        }
Ejemplo n.º 3
0
        private void Start()
        {
            _isInTutorial = !HPlayerPrefs.GetBool(GameplayController.TutorialPassedKey);

            GameplayController.GameStarted.AddListener(Setup);
            GameplayController.GameContinuedAfterRestart.AddListener(SetupAfterRestart);
            GameplayController.GameRestarted.AddListener(OnGameRestart);
            GameplayController.NewScoreReached.AddListener(OnNewScoreReached);

            _chunkPresets = ChunkController.Instance.ChunkPresets.ChunkPresets;

            _schemeQueue     = new Queue <ChunkScheme>();
            _shuffledSchemes = new List <ChunkScheme>();

            _currentPreset = GetMatchingPreset(0);
            ReloadLevelSettings(_currentPreset);
        }