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.

78 lines
1.9 KiB

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine.UI;
  4. using UnityEngine;
  5. public class MainMenuControllerServer : MonoBehaviour
  6. {
  7. // public GameObject SettingsMenu;
  8. public GameObject MainMenu;
  9. //public Button SoundButton;
  10. //public Button MusicButton;
  11. //public Button DifficultyButton;
  12. bool soundVolume = true;
  13. bool musicVolume = true;
  14. int difficulty = 1;
  15. //On Awake
  16. private void Awake()
  17. {
  18. MainMenu.SetActive(true);
  19. //SettingsMenu.SetActive(false);
  20. }
  21. //Main Menu Options
  22. public void OnPlayClick()
  23. {
  24. UnityEngine.SceneManagement.SceneManager.LoadScene("Lobby");
  25. }
  26. public void OnQuitClick()
  27. {
  28. Application.Quit();
  29. }
  30. public void OnSettingsClick()
  31. {
  32. //toggle which menu displays
  33. MainMenu.SetActive(false);
  34. //SettingsMenu.SetActive(true);
  35. }
  36. //Settings menu
  37. public void OnMusicVolumeClick()
  38. {
  39. if (musicVolume == true)
  40. {
  41. //backgroundMusic.Stop();
  42. //MusicButton.GetComponentInChildren<Text>().text = "Music Volume: OFF";
  43. musicVolume = false;
  44. }
  45. else
  46. {
  47. //backgroundMusic.Play();
  48. //MusicButton.GetComponentInChildren<Text>().text = "Music Volume: ON";
  49. musicVolume = true;
  50. }
  51. }
  52. public void OnDifficultyClick()
  53. {
  54. if (difficulty == 1)
  55. {
  56. //DifficultyButton.GetComponentInChildren<Text>().text = "Difficulty: MEDIUM";
  57. difficulty = 2;
  58. }
  59. else if (difficulty == 2)
  60. {
  61. //DifficultyButton.GetComponentInChildren<Text>().text = "Difficulty: HARD";
  62. difficulty = 3;
  63. }
  64. else
  65. {
  66. //DifficultyButton.GetComponentInChildren<Text>().text = "Difficulty: EASY";
  67. difficulty = 1;
  68. }
  69. }
  70. }