diff --git a/GottaGoFast/GottaGoFast.cs b/GottaGoFast/GottaGoFast.cs index 8d1a3e6..a090dbe 100644 --- a/GottaGoFast/GottaGoFast.cs +++ b/GottaGoFast/GottaGoFast.cs @@ -27,7 +27,10 @@ public override void OnLateUpdate() { if (slider.value < 0) { - partyModeToggle.isOn = true; + if (partyModeToggle.isOn == false) + { + partyModeToggle.isOn = true; + } GameObject scoreMultiplier = GameObject.Find("UI Config/SongCanvas/Content/ScoreMultiplier/ScoreMultiplier"); if (scoreMultiplier != null) { @@ -40,7 +43,10 @@ public override void OnLateUpdate() } else if (slider.value > 4) { - partyModeToggle.isOn = true; + if (partyModeToggle.isOn == false) + { + partyModeToggle.isOn = true; + } GameObject scoreMultiplier = GameObject.Find("UI Config/SongCanvas/Content/ScoreMultiplier/ScoreMultiplier"); if (scoreMultiplier != null) { @@ -58,25 +64,28 @@ public override void OnLateUpdate() } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { - MelonLogger.Msg("OnSceneWasLoaded was called"); - GameObject sliderVelocity = GameObject.Find("GameSetting/SliderVelocity/Slider"); - if (sliderVelocity != null) + if (sceneName == "MenuScene") { - Slider slider = sliderVelocity.GetComponent(); - if (slider != null) + MelonLogger.Msg("Menu Scene loaded. Changing Velocity Slider"); + GameObject sliderVelocity = GameObject.Find("GameSetting/SliderVelocity/Slider"); + if (sliderVelocity != null) { - slider.maxValue = 12; - slider.minValue = -7; + Slider slider = sliderVelocity.GetComponent(); + if (slider != null) + { + slider.maxValue = 12; + slider.minValue = -7; + } + else + { + MelonLogger.Error("Failed to get Component"); + } } else { - MelonLogger.Msg("Failed to get Component"); + MelonLogger.Error("Failed to find GameObject"); } } - else - { - MelonLogger.Msg("Failed to find GameObject"); - } } public override void OnApplicationStart() {