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.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);