using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.UI;
|
|
using UnityEngine;
|
|
|
|
public class MainMenuControllerClient : MonoBehaviour
|
|
{
|
|
public GameObject SettingsMenu;
|
|
public GameObject MainMenu;
|
|
public GameObject HowToPlayMenu;
|
|
|
|
public Button MusicButton;
|
|
bool musicVolume = true;
|
|
|
|
//On Awake
|
|
private void Awake ()
|
|
{
|
|
MainMenu.SetActive (true);
|
|
SettingsMenu.SetActive (false);
|
|
HowToPlayMenu.SetActive (false);
|
|
}
|
|
|
|
//Main Menu Options
|
|
public void OnPlayClick ()
|
|
{
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene ("LoginScreen");
|
|
}
|
|
|
|
public void OnSettingsClick ()
|
|
{
|
|
//toggle which menu displays
|
|
MainMenu.SetActive (false);
|
|
SettingsMenu.SetActive (true);
|
|
}
|
|
|
|
public void OnTutorialClick ()
|
|
{
|
|
MainMenu.SetActive (false);
|
|
HowToPlayMenu.SetActive (true);
|
|
}
|
|
|
|
public void OnTutorialContinueClick ()
|
|
{
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene ("TuteLevelOne");
|
|
}
|
|
|
|
//Settings Menu
|
|
public void OnBackClick ()
|
|
{
|
|
//Settings menu
|
|
SettingsMenu.SetActive (false);
|
|
MainMenu.SetActive (true);
|
|
}
|
|
|
|
public void OnMusicVolumeClick ()
|
|
{
|
|
if (musicVolume == true) {
|
|
//backgroundMusic.Stop();
|
|
MusicButton.GetComponentInChildren<Text> ().text = "Music Volume: OFF";
|
|
musicVolume = false;
|
|
} else {
|
|
//backgroundMusic.Play();
|
|
MusicButton.GetComponentInChildren<Text> ().text = "Music Volume: ON";
|
|
musicVolume = true;
|
|
}
|
|
}
|
|
}
|