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