]> git.lizzy.rs Git - SuperMouseAdventure.git/blob - 2DGame/Assets/Scripts/Mouse/Cheese.cs
coyote time
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Mouse / Cheese.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEngine.UI;
5
6 public class Cheese : MonoBehaviour
7 {
8     public Text countText;
9
10     [HideInInspector]
11     public int cheesecount;
12
13     public bool collected;
14
15     private void OnTriggerEnter2D(Collider2D collision)
16     {
17         if (collision.gameObject.CompareTag("Cheese"))
18         {
19             cheesecount++;
20
21             countText.text = cheesecount.ToString();
22
23             FindObjectOfType<AudioManager>().Play("cheese_plop");
24
25             collision.gameObject.SetActive(false);
26         }
27     }
28 }