fix clarinet ui

This commit is contained in:
Sam 2023-05-05 22:46:31 -07:00
parent d703883d94
commit 418d0e5566

View File

@ -110,9 +110,10 @@ public class PlayerBehavior : MonoBehaviour
unlockedClarinet = StateController.Instance.HasClarinet(); unlockedClarinet = StateController.Instance.HasClarinet();
if (unlockedClarinet) if (unlockedClarinet)
{ {
if (playerInput.actions["ClarinetDive"].WasPressedThisFrame() && !isInWater && !playerController.IsGrounded()) if (playerInput.actions["ClarinetDive"].WasPressedThisFrame() && !isInWater && !playerController.IsGrounded() && !isDash)
{ {
isDash = true; isDash = true;
this.gameUI.ToggleClarinet(false);
playerInput.DeactivateInput(); playerInput.DeactivateInput();
currentDash = 0.0f; currentDash = 0.0f;
} }
@ -131,6 +132,7 @@ public class PlayerBehavior : MonoBehaviour
{ {
if (!isInWater) { if (!isInWater) {
isDash = false; isDash = false;
this.gameUI.ToggleClarinet(true);
forceAdded = false; forceAdded = false;
_rb.AddForce(-(dashVec), ForceMode2D.Impulse); _rb.AddForce(-(dashVec), ForceMode2D.Impulse);
playerInput.ActivateInput(); playerInput.ActivateInput();
@ -140,6 +142,7 @@ public class PlayerBehavior : MonoBehaviour
} }
else { else {
isDash = false; isDash = false;
this.gameUI.ToggleClarinet(true);
forceAdded = false; forceAdded = false;
playerInput.ActivateInput(); playerInput.ActivateInput();
currentDash = 0.0f; currentDash = 0.0f;