aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs10
-rw-r--r--Assets/Sprites/Hoop.anim2
2 files changed, 10 insertions, 2 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);
diff --git a/Assets/Sprites/Hoop.anim b/Assets/Sprites/Hoop.anim
index eac1247..7bda0d1 100644
--- a/Assets/Sprites/Hoop.anim
+++ b/Assets/Sprites/Hoop.anim
@@ -75,7 +75,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
- m_LoopTime: 1
+ m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0