You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

96 lines
2.1 KiB

using UnityEngine.UI;
using UnityEngine;
public class MainMenuControllerServer : MonoBehaviour
{
public GameObject MainMenu;
public GameObject SettingsMenu;
public GameObject AboutMenu;
public GameObject CreditsMenu;
public Button MusicButton;
public Button playerMovesButton;
public AudioSource backgroundMusic;
private void Awake()
{
MainMenu.SetActive(true);
SettingsMenu.SetActive(false);
AboutMenu.SetActive(false);
CreditsMenu.SetActive(false);
}
public void OnPlayClick()
{
UnityEngine.SceneManagement.SceneManager.LoadScene("Lobby");
}
public void OnQuitClick()
{
Application.Quit();
}
public void OnAboutClick()
{
MainMenu.SetActive(false);
AboutMenu.SetActive(true);
}
public void OnCreditClick()
{
MainMenu.SetActive(false);
CreditsMenu.SetActive(true);
}
public void OnSettingsClick()
{
MainMenu.SetActive(false);
SettingsMenu.SetActive(true);
}
public void OnBackSettingsClick ()
{
SettingsMenu.SetActive (false);
MainMenu.SetActive (true);
}
public void OnBackAboutClick ()
{
AboutMenu.SetActive (false);
MainMenu.SetActive (true);
}
public void OnBackCreditClick ()
{
CreditsMenu.SetActive (false);
MainMenu.SetActive (true);
}
public void OnMusicVolumeClick()
{
if (GlobalVariables.musicVolume == true)
{
backgroundMusic.Stop();
MusicButton.GetComponentInChildren<Text>().text = "Music Volume: OFF";
GlobalVariables.musicVolume = false;
}
else
{
backgroundMusic.Play();
MusicButton.GetComponentInChildren<Text>().text = "Music Volume: ON";
GlobalVariables.musicVolume = true;
}
}
public void OnDisplayPlayerMoves()
{
if (GlobalVariables.playerMoves == true)
{
playerMovesButton.GetComponentInChildren<Text>().text = "Display Player Moves: OFF";
GlobalVariables.playerMoves = false;
}
else
{
playerMovesButton.GetComponentInChildren<Text>().text = "Display Player Moves: ON";
GlobalVariables.playerMoves = true;
}
}
}