From 418d0e556674c6c6c8085c43bb9b6c251b7c3071 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 5 May 2023 22:46:31 -0700 Subject: [PATCH] fix clarinet ui --- Assets/Scripts/PlayerBehavior.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/PlayerBehavior.cs b/Assets/Scripts/PlayerBehavior.cs index 5458394..fdec77e 100644 --- a/Assets/Scripts/PlayerBehavior.cs +++ b/Assets/Scripts/PlayerBehavior.cs @@ -110,9 +110,10 @@ public class PlayerBehavior : MonoBehaviour unlockedClarinet = StateController.Instance.HasClarinet(); if (unlockedClarinet) { - if (playerInput.actions["ClarinetDive"].WasPressedThisFrame() && !isInWater && !playerController.IsGrounded()) + if (playerInput.actions["ClarinetDive"].WasPressedThisFrame() && !isInWater && !playerController.IsGrounded() && !isDash) { isDash = true; + this.gameUI.ToggleClarinet(false); playerInput.DeactivateInput(); currentDash = 0.0f; } @@ -131,6 +132,7 @@ public class PlayerBehavior : MonoBehaviour { if (!isInWater) { isDash = false; + this.gameUI.ToggleClarinet(true); forceAdded = false; _rb.AddForce(-(dashVec), ForceMode2D.Impulse); playerInput.ActivateInput(); @@ -140,6 +142,7 @@ public class PlayerBehavior : MonoBehaviour } else { isDash = false; + this.gameUI.ToggleClarinet(true); forceAdded = false; playerInput.ActivateInput(); currentDash = 0.0f;