From 2c091f444b5ba0915e2bdd3a4c413b8919ca1d7b Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Thu, 4 Sep 2025 19:26:43 -0700 Subject: [PATCH] Make audio get faster when speedy berry is active --- Assets/Scripts/GamePlayer.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/GamePlayer.cs b/Assets/Scripts/GamePlayer.cs index 1a091de..b0892a2 100644 --- a/Assets/Scripts/GamePlayer.cs +++ b/Assets/Scripts/GamePlayer.cs @@ -391,12 +391,17 @@ public class GamePlayer : MonoBehaviour void Update() { - if (BazookaManager.Instance.GetSettingShowFPS() && Time.time > nextUpdate) + foreach (AudioSource audio in FindObjectsByType(FindObjectsSortMode.None)) { - fps = 1f / Time.deltaTime; - fpsCounter.text = "FPS: " + Mathf.Round(fps); - nextUpdate = Time.time + 0.25f; + if (speedyLeft != 0 && audio.pitch == 1f) audio.pitch = 1.3f; + if (speedyLeft == 0 && audio.pitch == 1.3f) audio.pitch = 1f; } + if (BazookaManager.Instance.GetSettingShowFPS() && Time.time > nextUpdate) + { + fps = 1f / Time.deltaTime; + fpsCounter.text = "FPS: " + Mathf.Round(fps); + nextUpdate = Time.time + 0.25f; + } if (screenWidth != Camera.main.orthographicSize * 2f * Camera.main.aspect) { screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect;