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.

52 lines
1000 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.InputSystem.HID;
  5. using UnityEngine.SceneManagement;
  6. using UnityEngine.UI;
  7. public class MainMenu : MonoBehaviour
  8. {
  9. public GameObject menu;
  10. public GameObject credits;
  11. public Button menuBtn;
  12. public Button creditsBtn;
  13. // Start is called before the first frame update
  14. void Start()
  15. {
  16. menu.SetActive(true);
  17. credits.SetActive(false);
  18. }
  19. public void SwapCanvas()
  20. {
  21. menu.SetActive(!menu.activeSelf);
  22. credits.SetActive(!credits.activeSelf);
  23. SwapButtons(menu.activeSelf);
  24. }
  25. public void SwapButtons(bool isActive)
  26. {
  27. if (isActive)
  28. {
  29. menuBtn.Select();
  30. }
  31. else
  32. {
  33. creditsBtn.Select();
  34. }
  35. }
  36. public void StartGame()
  37. {
  38. SceneManager.LoadScene(1);
  39. }
  40. // Update is called once per frame
  41. void Update()
  42. {
  43. }
  44. }