mirror of
https://github.com/Fluffy-Bean/Again.git
synced 2025-05-14 13:12:16 +00:00
Merged common scripts
This commit is contained in:
parent
90ce1284c1
commit
851c3aeffa
4 changed files with 40 additions and 39 deletions
10
gameExit.cs
10
gameExit.cs
|
@ -1,10 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class gameExit : MonoBehaviour
|
|
||||||
{
|
|
||||||
public void doExitGame() {
|
|
||||||
Application.Quit();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
40
menuScript.cs
Normal file
40
menuScript.cs
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue