aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts/Controllers/Hoop.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Scripts/Controllers/Hoop.cs')
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Assets/Scripts/Controllers/Hoop.cs b/Assets/Scripts/Controllers/Hoop.cs
new file mode 100644
index 0000000..58f7130
--- /dev/null
+++ b/Assets/Scripts/Controllers/Hoop.cs
@@ -0,0 +1,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!");
+ }
+ }
+} \ No newline at end of file