Skip to content

Commit

Permalink
Update GottaGoFast.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
joerkig committed Jun 9, 2021
1 parent cf2fbf1 commit 26f6cd3
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions GottaGoFast/GottaGoFast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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<Slider>();
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<Slider>();
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()
{
Expand Down

0 comments on commit 26f6cd3

Please sign in to comment.