2 using System.Collections;
3 using System.Collections.Generic;
5 using UnityEngine.Tilemaps;
7 public class Stamping : MonoBehaviour
9 MouseController mouseController;
13 private float stampingSpeed = 40;
15 private bool isStamping = false;
17 // Start is called before the first frame update
20 mouseController = GetComponent<MouseController>();
21 rb = GetComponent<Rigidbody2D>();
24 // Update is called once per frame
27 if (!mouseController.isGrounded)
29 if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
32 rb.velocity = Vector2.down * stampingSpeed;
35 else if (mouseController.isGrounded)
41 private void OnCollisionEnter2D(Collision2D collision)
43 if (collision.gameObject.CompareTag("Stamp") && isStamping)
45 collision.gameObject.SetActive(false);