Ejemplo n.º 1
0
        private void Start()
        {
            try
            {
                Console.WriteLine("Darth Maul Loaded");
                this._playerController = FindObjectOfType <PlayerController>();
                this._head             = ReflectionUtil.GetPrivateField <Transform>(_playerController, "_headTransform");
                this.isDarthModeOn     = Plugin.IsDarthModeOn;
                this.isOneHanded       = Plugin.IsOneHanded;
                this.mainController    = Plugin.MainController;
                this.isAutoDetect      = Plugin.IsAutoDetect;
                this.separation        = Plugin.Separation;

                hapticFeedbackHooks = new HapticFeedbackHooks();
                hapticFeedbackHooks.StartHooking();

                var _mainGameSceneSetup = FindObjectOfType <MainGameSceneSetup>();
                _mainGameSceneSetupData = ReflectionUtil.GetPrivateField <MainGameSceneSetupData>(_mainGameSceneSetup, "_mainGameSceneSetupData");

                if (Plugin.IsDarthModeOn && _mainGameSceneSetupData.gameplayMode == GameplayMode.SoloNoArrows)
                {
                    var _beatmapDataModel = ReflectionUtil.GetPrivateField <BeatmapDataModel>(_mainGameSceneSetup, "_beatmapDataModel");
                    var beatmapData       = CreateTransformedBeatmapData(_mainGameSceneSetupData.difficultyLevel.beatmapData, _mainGameSceneSetupData.gameplayOptions, _mainGameSceneSetupData.gameplayMode);
                    if (beatmapData != null)
                    {
                        _beatmapDataModel.beatmapData = beatmapData;
                        ReflectionUtil.SetPrivateField(_mainGameSceneSetup, "_beatmapDataModel", _beatmapDataModel);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
            }
        }
        private void Start()
        {
            try
            {
                Console.WriteLine("Darth Maul Loaded");
                this._playerController = FindObjectOfType <PlayerController>();
                this._head             = ReflectionUtil.GetPrivateField <Transform>(_playerController, "_headTransform");
                this.isDarthModeOn     = Plugin.IsDarthModeOn;
                this.isOneHanded       = Plugin.IsOneHanded;
                this.mainController    = Plugin.MainController;
                this.isAutoDetect      = Plugin.IsAutoDetect;
                this.separation        = Plugin.Separation;

                hapticFeedbackHooks = new HapticFeedbackHooks();
                hapticFeedbackHooks.StartHooking();

                //var _mainGameSceneSetup = FindObjectOfType<MainGameSceneSetup>();
                //_mainGameSceneSetupData = ReflectionUtil.GetPrivateField<MainGameSceneSetupData>(_mainGameSceneSetup, "_mainGameSceneSetupData");
                levelSetup = BS_Utils.Plugin.LevelData;
                GameplayCoreSceneSetup gameplayCoreSceneSetup = Resources.FindObjectsOfTypeAll <GameplayCoreSceneSetup>().First();


                if (Plugin.IsDarthModeOn)
                {
                    BS_Utils.Gameplay.ScoreSubmission.DisableSubmission("Darth Maul");
                    //var _beatmapDataModel = ReflectionUtil.GetPrivateField<BeatmapDataModel>(gameplayCoreSceneSetup, "_beatmapDataModel");
                    //var beatmapData = CreateTransformedBeatmapData(levelSetup.GameplayCoreSceneSetupData.difficultyBeatmap.beatmapData.GetCopy(), levelSetup);
                    //if (beatmapData != null)
                    //{
                    //    _beatmapDataModel.beatmapData = beatmapData;

                    //}
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
            }
        }