X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=2DGame%2FAssets%2FScripts%2FMouse%2FStamping.cs;h=76dff765f6fc28aa19dc7a291f658516da13a829;hb=772b200327b1d84646614c00b271316dd2722dc5;hp=0f1160bf4a9b9ee959be7ab755c4e095ad21c376;hpb=806efd1635a596a2ed4b1a0b64f48450c7e3a3d7;p=SuperMouseAdventure.git diff --git a/2DGame/Assets/Scripts/Mouse/Stamping.cs b/2DGame/Assets/Scripts/Mouse/Stamping.cs index 0f1160b..76dff76 100644 --- a/2DGame/Assets/Scripts/Mouse/Stamping.cs +++ b/2DGame/Assets/Scripts/Mouse/Stamping.cs @@ -12,6 +12,12 @@ public class Stamping : MonoBehaviour [SerializeField] private float stampingSpeed = 40; + [SerializeField] + GameObject groundCheck; + + [SerializeField] + GameObject dustEffect; + private bool isStamping = false; // Start is called before the first frame update @@ -32,9 +38,12 @@ public class Stamping : MonoBehaviour rb.velocity = Vector2.down * stampingSpeed; } } - else if (mouseController.isGrounded) + else if (mouseController.isGrounded && isStamping) { isStamping = false; + Vector3 spawnPos = new Vector3(groundCheck.transform.position.x, groundCheck.transform.position.y + 1, groundCheck.transform.position.z); + Instantiate(dustEffect, spawnPos, Quaternion.identity); + } }