]> git.cameronkatri.com Git - gmtk-gamejam.git/commitdiff
Add crowd cheer on goal 2
authorCameron Katri <me@cameronkatri.com>
Sun, 13 Jun 2021 03:26:00 +0000 (23:26 -0400)
committerCameron Katri <me@cameronkatri.com>
Sun, 13 Jun 2021 03:26:00 +0000 (23:26 -0400)
Assets/Scripts/Controllers/Hoop.cs

index 39c7a6f3d981bb6be1b67774fa048aaf982739c2..7e924e72ba608c0c76d9a76bf04fbe49ecff1e00 100644 (file)
@@ -3,6 +3,7 @@ using UnityEngine;
 
 namespace Controllers
 {
+       [RequireComponent(typeof(AudioSource))]
        [RequireComponent(typeof(AudioSource))]
        public class Hoop : MonoBehaviour
        {
@@ -11,6 +12,7 @@ namespace Controllers
                [SerializeField] private BoxCollider2D Rim;
                [SerializeField] private BoxCollider2D Net;
                [SerializeField] private AudioSource shotSound;
+               [SerializeField] private AudioSource crowdSound;
 
                private Animator HoopAnimator;
 
@@ -28,6 +30,7 @@ namespace Controllers
                                        controller.player.Score(Rim.transform.position);
                                else if (this == controller.EnemyHoop)
                                        controller.enemy.Score(Rim.transform.position);
+                               crowdSound.Play();
                        }
                }
        }