|
|
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine.UI;
- using UnityEngine;
-
- public class MainMenuControllerServer : MonoBehaviour
- {
- // public GameObject SettingsMenu;
- public GameObject MainMenu;
-
- //public Button SoundButton;
- //public Button MusicButton;
- //public Button DifficultyButton;
-
- bool soundVolume = true;
- bool musicVolume = true;
- int difficulty = 1;
-
- //On Awake
- private void Awake()
- {
- MainMenu.SetActive(true);
- //SettingsMenu.SetActive(false);
- }
-
- //Main Menu Options
- public void OnPlayClick()
- {
- UnityEngine.SceneManagement.SceneManager.LoadScene("Lobby");
- }
- public void OnQuitClick()
- {
- Application.Quit();
- }
-
- public void OnSettingsClick()
- {
- //toggle which menu displays
- MainMenu.SetActive(false);
- //SettingsMenu.SetActive(true);
- }
-
- //Settings menu
- 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 OnDifficultyClick()
- {
- if (difficulty == 1)
- {
- //DifficultyButton.GetComponentInChildren<Text>().text = "Difficulty: MEDIUM";
- difficulty = 2;
- }
- else if (difficulty == 2)
- {
- //DifficultyButton.GetComponentInChildren<Text>().text = "Difficulty: HARD";
- difficulty = 3;
- }
- else
- {
- //DifficultyButton.GetComponentInChildren<Text>().text = "Difficulty: EASY";
- difficulty = 1;
- }
- }
- }
|