using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.UI;
|
|
using UnityEngine;
|
|
|
|
public class MainMenuController : MonoBehaviour
|
|
{
|
|
public Canvas GameOptionsMenu;
|
|
public Canvas SettingsMenu;
|
|
public Canvas MainMenu;
|
|
public Canvas HowToPlayMenu;
|
|
|
|
public Button SoundButton;
|
|
public Button MusicButton;
|
|
|
|
bool soundVolume = true;
|
|
bool musicVolume = true;
|
|
|
|
//On Awake
|
|
private void Awake ()
|
|
{
|
|
MainMenu.enabled = true;
|
|
SettingsMenu.enabled = false;
|
|
GameOptionsMenu.enabled = false;
|
|
HowToPlayMenu.enabled = false;
|
|
}
|
|
|
|
//Main Menu Options
|
|
public void OnPlayClick ()
|
|
{
|
|
//toggle which menu displays
|
|
MainMenu.enabled = false;
|
|
GameOptionsMenu.enabled = true;
|
|
}
|
|
|
|
public void OnSettingsClick ()
|
|
{
|
|
//toggle which menu displays
|
|
MainMenu.enabled = false;
|
|
SettingsMenu.enabled = true;
|
|
}
|
|
|
|
public void OnTutorialClick ()
|
|
{
|
|
HowToPlayMenu.enabled = true;
|
|
}
|
|
public void OnTutorialContinueClick ()
|
|
{
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene ("TuteLevelOne");
|
|
}
|
|
|
|
//Game Options and Settings Menu
|
|
public void OnBackClick ()
|
|
{
|
|
GameOptionsMenu.enabled = false;
|
|
SettingsMenu.enabled = false;
|
|
MainMenu.enabled = true;
|
|
}
|
|
|
|
//Game Options Menu
|
|
public void OnRecompileRaceClick ()
|
|
{
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene ("ReCompileRaceOne");
|
|
}
|
|
|
|
public void OnColourCollideClick ()
|
|
{
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene ("ColourCollideOne");
|
|
}
|
|
|
|
public void OnChickenRunClick ()
|
|
{
|
|
UnityEngine.SceneManagement.SceneManager.LoadScene ("ChickenRunOne");
|
|
}
|
|
|
|
//Settings menu
|
|
public void OnSoundVolumeClick ()
|
|
{
|
|
if (soundVolume == true) {
|
|
SoundButton.GetComponentInChildren<Text> ().text = "Sound Volume: OFF";
|
|
soundVolume = false;
|
|
} else {
|
|
SoundButton.GetComponentInChildren<Text> ().text = "Sound Volume: ON";
|
|
soundVolume = 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;
|
|
}
|
|
}
|
|
|
|
public void OnUnknownClick ()
|
|
{
|
|
|
|
}
|
|
}
|