]> git.cameronkatri.com Git - gmtk-gamejam.git/commitdiff
Fix hoop animation
authorCameron Katri <me@cameronkatri.com>
Sun, 13 Jun 2021 00:58:54 +0000 (20:58 -0400)
committerCameron Katri <me@cameronkatri.com>
Sun, 13 Jun 2021 00:58:54 +0000 (20:58 -0400)
Assets/Scripts/Controllers/Hoop.cs
Assets/Sprites/Hoop.anim

index 56337437f7e1adb39c40361fefab7f16ea1e863a..8809b87be858425023cd7522694a5d88982d14e4 100644 (file)
@@ -11,13 +11,21 @@ namespace Controllers
                [SerializeField] private BoxCollider2D Rim;
                [SerializeField] private BoxCollider2D Net;
                [SerializeField] private AudioSource shotSound;
                [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))
                        {
                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);
                                shotSound.Play();
                                if (this == controller.PlayerHoop)
                                        controller.player.Score(Rim.transform.position);
index eac1247e9406f49a77d0be74a11666c45ddfafb7..7bda0d1f757771c5d5c79b9f61459be97258e0e8 100644 (file)
@@ -75,7 +75,7 @@ AnimationClip:
     m_Level: 0
     m_CycleOffset: 0
     m_HasAdditiveReferencePose: 0
     m_Level: 0
     m_CycleOffset: 0
     m_HasAdditiveReferencePose: 0
-    m_LoopTime: 1
+    m_LoopTime: 0
     m_LoopBlend: 0
     m_LoopBlendOrientation: 0
     m_LoopBlendPositionY: 0
     m_LoopBlend: 0
     m_LoopBlendOrientation: 0
     m_LoopBlendPositionY: 0