aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-06-12 16:42:21 -0400
committerCameron Katri <me@cameronkatri.com>2021-06-12 16:42:21 -0400
commitd64b65fed63cd4fb5cc1112fabc8850ddd1f6507 (patch)
tree97548fa4461f7e43d9d7e130a087dea8c0e88346 /Assets/Scripts
parent6bd59f3f902328c5c2ac19f0a03abb1194c113c9 (diff)
downloadgmtk-gamejam-d64b65fed63cd4fb5cc1112fabc8850ddd1f6507.tar.gz
gmtk-gamejam-d64b65fed63cd4fb5cc1112fabc8850ddd1f6507.tar.zst
gmtk-gamejam-d64b65fed63cd4fb5cc1112fabc8850ddd1f6507.zip
PlayerHoop log on hit
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs19
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs.meta3
2 files changed, 22 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
diff --git a/Assets/Scripts/Controllers/Hoop.cs.meta b/Assets/Scripts/Controllers/Hoop.cs.meta
new file mode 100644
index 0000000..29125c3
--- /dev/null
+++ b/Assets/Scripts/Controllers/Hoop.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 40e5d6a883d14c7fb60913ec2fc3009c
+timeCreated: 1623524972 \ No newline at end of file