add scream and wrong button to assets and sound manager
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user