Need to fix PauseMenu when load fist level because it's always displayed Need to find a way to access to DontDestroyOnLoad Objects to get back Settings Menu
34 lines
675 B
C#
34 lines
675 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class MainMenu : MonoBehaviour {
|
|
|
|
public string levelToLoad;
|
|
|
|
public GameObject settingPanel;
|
|
public GameObject gameName;
|
|
public void StartGame()
|
|
{
|
|
SceneManager.LoadScene(levelToLoad);
|
|
Time.timeScale = 1;
|
|
}
|
|
|
|
public void SettingsOpen()
|
|
{
|
|
settingPanel.SetActive(true);
|
|
gameName.SetActive(false);
|
|
}
|
|
|
|
public void SettingsClose()
|
|
{
|
|
settingPanel.SetActive(false);
|
|
gameName.SetActive(true);
|
|
}
|
|
public void QuitGame()
|
|
{
|
|
Application.Quit();
|
|
}
|
|
}
|