From abe08f049004bf32b0c763b3330c452490fa9c3a Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Sat, 12 Jun 2021 20:58:54 -0400 Subject: Fix hoop animation --- Assets/Scripts/Controllers/Hoop.cs | 10 +++++++++- Assets/Sprites/Hoop.anim | 2 +- 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(); + } + private void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent() == 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 -- cgit v1.2.3-56-ge451