aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-06-12 20:58:54 -0400
committerCameron Katri <me@cameronkatri.com>2021-06-12 20:58:54 -0400
commitabe08f049004bf32b0c763b3330c452490fa9c3a (patch)
treeb7166720ffc3843f0299d7f916fa15724bacb7f0 /Assets/Scripts
parentca2356eb3f3c88745d5ecc646383f49ff301be90 (diff)
downloadgmtk-gamejam-abe08f049004bf32b0c763b3330c452490fa9c3a.tar.gz
gmtk-gamejam-abe08f049004bf32b0c763b3330c452490fa9c3a.tar.zst
gmtk-gamejam-abe08f049004bf32b0c763b3330c452490fa9c3a.zip
Fix hoop animation
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Assets/Scripts/Controllers/Hoop.cs b/Assets/Scripts/Controllers/Hoop.cs
index 5633743..8809b87 100644
--- a/Assets/Scripts/Controllers/Hoop.cs
+++ b/Assets/Scripts/Controllers/Hoop.cs
@@ -11,13 +11,21 @@ namespace Controllers
[SerializeField] private BoxCollider2D Rim;
[SerializeField] private BoxCollider2D Net;
[SerializeField] private AudioSource shotSound;
-
+
+ private Animator HoopAnimator;
+
+ private void Awake()
+ {
+ HoopAnimator = GetComponentInChildren<Animator>();
+ }
+
private void OnTriggerEnter2D(Collider2D other)
{
if (other.GetComponent<Ball>() == null) return;
if (Rim.IsTouching(other) && Net.IsTouching(other))
{
+ HoopAnimator.Rebind();
shotSound.Play();
if (this == controller.PlayerHoop)
controller.player.Score(Rim.transform.position);