Seascape/Assets/Scripts/MenueScript.cs

44 lines
779 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenueScript : MonoBehaviour
{
public void About()
{
SceneManager.LoadSceneAsync(4);
}
public void StartGame()
{
SceneManager.LoadSceneAsync(1);
}
bool isPaused = false;
public void pauseGame()
{
Time.timeScale = 0;
isPaused = true;
SceneManager.LoadSceneAsync(2);
}
public void Unpause()
{
SceneManager.UnloadSceneAsync(2);
SceneManager.LoadScene(1);
if (isPaused == true)
{
Time.timeScale = 1;
isPaused = false;
}
}
public void Quit()
{
Application.Quit();
}
}