diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index dc32e3f9..85bfa7d4 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -254,7 +254,9 @@ namespace NewHorizons.Builder.Body fog._fogDensity *= scale; var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); - volumesShape.GetComponent().radius *= scale; + var sphereShape = volumesShape.GetComponent(); + sphereShape.enabled = true; // this starts disabled for some fucking reason + sphereShape.radius *= scale; // Change fog color if (body.Config.Bramble.dimension.fogTint != null) diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 8f71830c..94bdb871 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -45,31 +45,25 @@ namespace NewHorizons.Builder.Props private static void InitPrefabs() { // Just take every scroll and get the first arc - var existingArcs = GameObject.FindObjectsOfType().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray(); + var arcs = GameObject.FindObjectsOfType().Select(x => x?._nomaiWallText?.gameObject?.transform?.Find("Arc 1")?.gameObject).Where(x => x != null).ToArray(); _arcPrefabs = new List(); _childArcPrefabs = new List(); - foreach (var existingArc in existingArcs) + foreach (var arc in arcs) { - if (existingArc.GetComponent().material.name.Contains("Child")) + if (arc.GetComponent().material.name.Contains("Child")) { - var arc = existingArc.InstantiateInactive(); - arc.name = "Arc (Child)"; _childArcPrefabs.Add(arc); } else { - var arc = existingArc.InstantiateInactive(); - arc.name = "Arc"; _arcPrefabs.Add(arc); } } - var existingGhostArcs = GameObject.FindObjectsOfType().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray(); + var ghostArcs = GameObject.FindObjectsOfType().Select(x => x?._textLine?.gameObject).Where(x => x != null).ToArray(); _ghostArcPrefabs = new List(); - foreach (var existingArc in existingGhostArcs) + foreach (var arc in ghostArcs) { - var arc = existingArc.InstantiateInactive(); - arc.name = "Arc"; _ghostArcPrefabs.Add(arc); } diff --git a/NewHorizons/Handlers/SubtitlesHandler.cs b/NewHorizons/Handlers/SubtitlesHandler.cs index 737c6b0b..d1cc0b00 100644 --- a/NewHorizons/Handlers/SubtitlesHandler.cs +++ b/NewHorizons/Handlers/SubtitlesHandler.cs @@ -26,8 +26,6 @@ namespace NewHorizons.Handlers public Sprite eoteSprite; public int subtitleIndex; - public System.Random randomizer; - public static readonly int PAUSE_TIMER_MAX = 50; public int pauseTimer = PAUSE_TIMER_MAX; @@ -45,8 +43,6 @@ namespace NewHorizons.Handlers public void Start() { - randomizer = new System.Random(); - GetComponent().alpha = 1; graphic = GetComponent(); image = GetComponent(); @@ -87,7 +83,7 @@ namespace NewHorizons.Handlers possibleSubtitles.Add(sprite); } - public void Update() + public void FixedUpdate() { CheckForEOTE(); @@ -132,14 +128,7 @@ namespace NewHorizons.Handlers public void ChangeSubtitle() { - // to pick a new random subtitle without requiring retries, we generate a random offset less than the length of the possible subtitles array - // we then add that offset to the current index, modulo NUMBER_OF_POSSIBLE_SUBTITLES - // since the offset can never be NUMBER_OF_POSSIBLE_SUBTITLES, it will never wrap all the way back around to the initial subtitleIndex - - // note, this makes the code more confusing, but Random.Next(min, max) generates a random number on the range [min, max) - // that is, the below code will generate numbers up to and including Count-1, not Count. - var newIndexOffset = randomizer.Next(1, possibleSubtitles.Count); - subtitleIndex = (subtitleIndex + newIndexOffset) % possibleSubtitles.Count; + subtitleIndex = (subtitleIndex + 1) % possibleSubtitles.Count; image.sprite = possibleSubtitles[subtitleIndex]; }