You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
572 B
24 lines
572 B
2 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using TMPro;
|
||
|
|
||
|
public class ItemColliector : MonoBehaviour
|
||
|
{
|
||
|
private int Blue_Cheese = 0;
|
||
|
|
||
|
public TMP_Text BlueCheeseText;
|
||
|
|
||
|
private void OnTriggerEnter2D(Collider2D collision)
|
||
|
{
|
||
|
if (collision.gameObject.CompareTag("Blue Cheese"))
|
||
|
{
|
||
|
Destroy(collision.gameObject);
|
||
|
Blue_Cheese++;
|
||
|
Debug.Log("Blue Cheeses: " + Blue_Cheese);
|
||
|
BlueCheeseText.text = "Blue Cheese: " + Blue_Cheese;
|
||
|
}
|
||
|
}
|
||
|
}
|