add scream and wrong button to assets and sound manager

This commit is contained in:
chyknkat
2020-02-01 21:30:59 -05:00
parent e4294a01ac
commit c801dbbec6
5 changed files with 53 additions and 1 deletions

View File

@@ -5,13 +5,15 @@ using UnityEngine;
public class SoundManagerScript : MonoBehaviour
{
public static AudioClip jumpSound;
public static AudioClip jumpSound, screamSound, wrongButtonSound;
static AudioSource audioSrc;
// Start is called before the first frame update
void Start()
{
jumpSound = Resources.Load<AudioClip>("Audio/Jump");
jumpSound = Resources.Load<AudioClip>("Audio/GirlyScream");
jumpSound = Resources.Load<AudioClip>("Audio/WrongButton");
audioSrc = GetComponent<AudioSource>();
}
@@ -29,6 +31,12 @@ public class SoundManagerScript : MonoBehaviour
case "jump":
audioSrc.PlayOneShot(jumpSound);
break;
case "scream":
audioSrc.PlayOneShot(screamSound);
break;
case "wrong":
audioSrc.PlayOneShot(wrongButtonSound);
break;
}
}
}