From: Cameron Katri Date: Sun, 13 Jun 2021 00:58:54 +0000 (-0400) Subject: Fix hoop animation X-Git-Url: https://git.cameronkatri.com/gmtk-gamejam.git/commitdiff_plain/abe08f049004bf32b0c763b3330c452490fa9c3a?ds=sidebyside Fix hoop animation --- 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