private GameSaberSetup(PluginConfig config, SaberSet saberSet, MainAssetStore mainAssetStore,
                               IReadonlyBeatmapData beatmap, RandomUtil randomUtil)
        {
            _config         = config;
            _saberSet       = saberSet;
            _mainAssetStore = mainAssetStore;
            _beatmapData    = beatmap.CastChecked <BeatmapData>();
            _randomUtil     = randomUtil;

            _oldLeftSaberModel  = _saberSet.LeftSaber;
            _oldRightSaberModel = _saberSet.RightSaber;

            Setup();
        }
Beispiel #2
0
        public void SetPartEventList(List <PartEvents> partEventsList, SaberType saberType)
        {
            _partEventsList = partEventsList;
            _saberType      = saberType;

            if (!_pluginConfig.EnableEvents)
            {
                return;
            }

            if (_gameCoreSceneSetupData == null)
            {
                return;
            }

            IsActive = true;

            _lastNoteTime = _beatmapData.CastChecked <BeatmapData>()?.GetLastNoteTime();

            if (!_lastNoteTime.HasValue)
            {
                _logger.Warn("Couldn't get last note time. Certain level end events won't work");
            }

            // OnSlice LevelEnded Combobreak
            _beatmapObjectManager.noteWasCutEvent    += OnNoteCut;
            _beatmapObjectManager.noteWasMissedEvent += OnNoteMiss;

            // Sabers clashing
            if (_obstacleSaberSparkleEffectManager)
            {
                _obstacleSaberSparkleEffectManager.sparkleEffectDidStartEvent += SaberStartCollide;
                _obstacleSaberSparkleEffectManager.sparkleEffectDidEndEvent   += SaberEndCollide;
            }

            // OnLevelFail
            _energyCounter.gameEnergyDidReach0Event += InvokeOnLevelFail;

            // MultiplierUp
            _scoreController.multiplierDidChangeEvent += MultiplayerDidChange;

            // Accuracy changed
            _scoreCounter.relativeScoreOrImmediateRankDidChangeEvent += ScoreChanged;

            // Combo changed
            _comboController.comboDidChangeEvent += OnComboDidChangeEvent;

            InvokeOnLevelStart();
        }