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.

67 lines
1.4 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine.UI;
  4. using UnityEngine;
  5. public class MainMenuControllerClient : MonoBehaviour
  6. {
  7. public GameObject SettingsMenu;
  8. public GameObject MainMenu;
  9. public GameObject HowToPlayMenu;
  10. public Button MusicButton;
  11. bool musicVolume = true;
  12. //On Awake
  13. private void Awake ()
  14. {
  15. MainMenu.SetActive (true);
  16. SettingsMenu.SetActive (false);
  17. HowToPlayMenu.SetActive (false);
  18. }
  19. //Main Menu Options
  20. public void OnPlayClick ()
  21. {
  22. UnityEngine.SceneManagement.SceneManager.LoadScene ("LoginScreen");
  23. }
  24. public void OnSettingsClick ()
  25. {
  26. //toggle which menu displays
  27. MainMenu.SetActive (false);
  28. SettingsMenu.SetActive (true);
  29. }
  30. public void OnTutorialClick ()
  31. {
  32. MainMenu.SetActive (false);
  33. HowToPlayMenu.SetActive (true);
  34. }
  35. public void OnTutorialContinueClick ()
  36. {
  37. UnityEngine.SceneManagement.SceneManager.LoadScene ("TuteLevelOne");
  38. }
  39. //Settings Menu
  40. public void OnBackClick ()
  41. {
  42. //Settings menu
  43. SettingsMenu.SetActive (false);
  44. MainMenu.SetActive (true);
  45. }
  46. public void OnMusicVolumeClick ()
  47. {
  48. if (musicVolume == true) {
  49. //backgroundMusic.Stop();
  50. MusicButton.GetComponentInChildren<Text> ().text = "Music Volume: OFF";
  51. musicVolume = false;
  52. } else {
  53. //backgroundMusic.Play();
  54. MusicButton.GetComponentInChildren<Text> ().text = "Music Volume: ON";
  55. musicVolume = true;
  56. }
  57. }
  58. }