mirror of
https://github.com/Kizuren/ShantiManti.git
synced 2025-12-21 13:06:04 +01:00
Removed a coin bug
This commit is contained in:
parent
a1a563a7fa
commit
aa6085b151
2 changed files with 9 additions and 2 deletions
|
|
@ -25,8 +25,8 @@ public class SC_2DCoin : MonoBehaviour
|
|||
_canPickUp = false; // Disable picking up coins temporarily
|
||||
|
||||
TotalCoins++;
|
||||
|
||||
c2d.GetComponent<PlayerMovement>().PlayCoinSound();
|
||||
|
||||
PlayerMovement.ShouldPlayCoinSound = true;
|
||||
Destroy(gameObject);
|
||||
|
||||
// Start the cooldown coroutine
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public class PlayerMovement : MonoBehaviour
|
|||
private static readonly int IsCrouching = Animator.StringToHash("IsCrouching");
|
||||
|
||||
public static InputActions InputActions;
|
||||
public static bool ShouldPlayCoinSound;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
|
|
@ -95,6 +96,12 @@ public class PlayerMovement : MonoBehaviour
|
|||
{
|
||||
animator.SetBool(IsJumping, true);
|
||||
}
|
||||
|
||||
if (ShouldPlayCoinSound)
|
||||
{
|
||||
ShouldPlayCoinSound = false;
|
||||
PlayCoinSound();
|
||||
}
|
||||
}
|
||||
|
||||
public void OnLanding()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue