private void SceneManagerOnSceneLoaded(Scene newScene, LoadSceneMode mode)
        {
            _eventManager = gameObject.GetComponent <EventManager>();
            if (_eventManager == null)
            {
                _eventManager = gameObject.AddComponent <EventManager>();
            }

            _scoreController = Resources.FindObjectsOfTypeAll <ScoreController>().FirstOrDefault();
            if (_scoreController == null)
            {
                return;
            }

            //_eventManager.OnLevelStart?.Invoke(); // replaced by LevelStartedEvent()

            _saberCollisionManager =
                Resources.FindObjectsOfTypeAll <ObstacleSaberSparkleEffectManager>().FirstOrDefault();
            _gameEnergyCounter = Resources.FindObjectsOfTypeAll <GameEnergyCounter>().FirstOrDefault();
            _beatmapObjectCallbackController = Resources.FindObjectsOfTypeAll <BeatmapObjectCallbackController>().FirstOrDefault();
            _beatmapDataModel = Resources.FindObjectsOfTypeAll <BeatmapDataSO>().FirstOrDefault();

            _scoreController.noteWasCutEvent          += SliceCallBack;
            _scoreController.noteWasMissedEvent       += NoteMissCallBack;
            _scoreController.multiplierDidChangeEvent += MultiplierCallBack;
            _scoreController.comboDidChangeEvent      += ComboChangeEvent;

            if (_saberCollisionManager)
            {
                _saberCollisionManager.sparkleEffectDidStartEvent += SaberStartCollide;
                _saberCollisionManager.sparkleEffectDidEndEvent   += SaberEndCollide;
            }

            if (_gameEnergyCounter)
            {
                _gameEnergyCounter.gameEnergyDidReach0Event += FailLevelCallBack;
            }

            if (_beatmapObjectCallbackController)
            {
                _beatmapObjectCallbackController.beatmapEventDidTriggerEvent += OnBeatmapEventDidTriggerEvent;
            }

            _lastNoteId = -1;

            /*if (_beatmapDataModel)
             * {
             *  _beatmapDataModel.beatmapDataDidChangeEvent += BeatmapDataChangedCallback;
             *  BeatmapDataChangedCallback();
             * }*/
        }
Exemplo n.º 2
0
 public CustomDifficultyBeatmap(IStandardLevel parentLevel, LevelDifficulty difficulty, int difficultyRank, float noteJumpMovementSpeed, BeatmapDataSO beatmapData) : base(parentLevel, difficulty, difficultyRank, noteJumpMovementSpeed, beatmapData)
 {
 }
Exemplo n.º 3
0
 public CustomDifficultyBeatmap(IBeatmapLevel parentLevel, BeatmapDifficulty difficulty, int difficultyRank, float noteJumpMovementSpeed, int noteJumpStartBeatOffset, BeatmapDataSO beatmapData, string characteristic = "") : base(parentLevel, difficulty, difficultyRank, noteJumpMovementSpeed, noteJumpStartBeatOffset, beatmapData)
 {
     Characteristic = characteristic;
 }
Exemplo n.º 4
0
 public CustomDifficultyBeatmap(IBeatmapLevel parentLevel, BeatmapDifficulty difficulty, int difficultyRank, float noteJumpMovementSpeed, int noteJumpStartBeatOffset, BeatmapDataSO beatmapData) : base(parentLevel, difficulty, difficultyRank, noteJumpMovementSpeed, noteJumpStartBeatOffset, beatmapData)
 {
 }