19 lines
426 B
C#
19 lines
426 B
C#
using UnityEngine;
|
|
|
|
public class BasketController : MonoBehaviour
|
|
{
|
|
public ScoreManager scoreManager;
|
|
|
|
private void OnCollisionEnter2D(Collision2D collision)
|
|
{
|
|
Debug.Log("2D Solid hit with: " + collision.gameObject.name);
|
|
|
|
if (collision.gameObject.CompareTag("Interactable"))
|
|
{
|
|
scoreManager.AddPoints(1);
|
|
|
|
GameObject.Destroy(collision.gameObject);
|
|
}
|
|
}
|
|
}
|