blob: 58f71302d79335662724560e7e5f09793b2bb4f5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
using System;
using UnityEngine;
namespace Controllers
{
public class Hoop : MonoBehaviour
{
[SerializeField] private BoxCollider2D Rim;
[SerializeField] private BoxCollider2D Net;
private void OnTriggerEnter2D(Collider2D other)
{
if (other.GetComponent<Ball>() == null) return;
if (Rim.IsTouching(other) && Net.IsTouching(other))
Debug.Log("Swish!");
}
}
}
|