diff --git a/gameExit.cs b/gameExit.cs deleted file mode 100644 index bcc83c4..0000000 --- a/gameExit.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class gameExit : MonoBehaviour -{ - public void doExitGame() { - Application.Quit(); - } -} diff --git a/levelLoader.cs b/levelLoader.cs deleted file mode 100644 index ff8c34f..0000000 --- a/levelLoader.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class levelLoader : MonoBehaviour -{ - public void NextLevel() - { - if (SceneManager.GetActiveScene().name == "menu") - { - PlayerPrefs.SetFloat("lowestTime",9999f); - } - SceneManager.LoadScene("game"); - Time.timeScale = 1f; - } -} diff --git a/menuScript.cs b/menuScript.cs new file mode 100644 index 0000000..2eef6bf --- /dev/null +++ b/menuScript.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Audio; +using UnityEngine.SceneManagement; + +public class menuScript : MonoBehaviour +{ + // Scene changer + public void NextLevel() + { + SceneManager.LoadScene("game"); + Time.timeScale = 1f; + } + public void MainMenu() + { + SceneManager.LoadScene("menu"); + } + public void Settings() + { + SceneManager.LoadScene("settings"); + } + + // Buttons + public void ExitGame() + { + Application.Quit(); + } + public void ResetScore() + { + PlayerPrefs.SetFloat("lowestTime",999999f); + } + + // Sliders + public AudioMixer audioMixer; + public void SetVolume(float volume) + { + audioMixer.SetFloat("Volume", volume); + } +} diff --git a/scoreReset.cs b/scoreReset.cs deleted file mode 100644 index caccf98..0000000 --- a/scoreReset.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class scoreReset : MonoBehaviour -{ - public void SendBack() - { - SceneManager.LoadScene("menu"); - } -}