diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-06-12 16:42:21 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-06-12 16:42:21 -0400 |
commit | d64b65fed63cd4fb5cc1112fabc8850ddd1f6507 (patch) | |
tree | 97548fa4461f7e43d9d7e130a087dea8c0e88346 /Assets/Scripts | |
parent | 6bd59f3f902328c5c2ac19f0a03abb1194c113c9 (diff) | |
download | gmtk-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.cs | 19 | ||||
-rw-r--r-- | Assets/Scripts/Controllers/Hoop.cs.meta | 3 |
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 |