1 using System.Collections;
2 using System.Collections.Generic;
6 public class Cheese : MonoBehaviour
11 public int cheesecount;
13 public bool collected;
20 private void OnTriggerEnter2D(Collider2D collision)
22 if (collision.gameObject.CompareTag("Cheese"))
24 SetCheeseCount(cheesecount + 1);
26 FindObjectOfType<AudioManager>().Play("cheese_plop");
28 collision.gameObject.SetActive(false);
32 public void SetCheeseCount(int count)
35 countText.text = cheesecount.ToString();