diff --git a/Assets/Scripts/Audio/AudioSwitcher.cs b/Assets/Scripts/Audio/AudioSwitcher.cs index e1248f78..1d853949 100644 --- a/Assets/Scripts/Audio/AudioSwitcher.cs +++ b/Assets/Scripts/Audio/AudioSwitcher.cs @@ -18,6 +18,8 @@ public class AudioSwitcher : MonoBehaviour s.source.volume = s.volume; s.source.pitch = s.pitch; } + + Play("Startgame"); /* foreach(Sounds p in phrases) { diff --git a/Assets/Scripts/Audio/Gameover.cs b/Assets/Scripts/Audio/Gameover.cs new file mode 100644 index 00000000..c39ce12e --- /dev/null +++ b/Assets/Scripts/Audio/Gameover.cs @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Audio; + +public class Gameover : MonoBehaviour +{ + public AudioSource source; + public GameObject fake; + + // Update is called once per frame + void Update() + { + if(fake.activeSelf == true && Extralife.staticLives < 1 ) + { + source.Play(); + } + } +} diff --git a/Assets/Scripts/Audio/Gameover.cs.meta b/Assets/Scripts/Audio/Gameover.cs.meta new file mode 100644 index 00000000..0b7c7725 --- /dev/null +++ b/Assets/Scripts/Audio/Gameover.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 393d2b0e827f7c4498aa535f4ef132f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: