Files

101 lines
2.7 KiB
C#
Raw Permalink Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
2020-02-09 22:49:06 -05:00
using TMPro;
[System.Serializable]
public class MainMenu : MonoBehaviour
{
public GameObject menuFirstButton;
public GameObject skinsFirstButton;
public GameObject highscoreFirstButton;
public GameObject gameinfoFirstButton;
public GameObject optionsFirstButton;
public GameObject skinsBackButton;
public GameObject highscoreBackButton;
public GameObject gameinfoBackButton;
public GameObject optionsBackButton;
2020-02-09 22:49:06 -05:00
public TextMeshProUGUI BeanTalk;
public string[] phrases;
void Start()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(menuFirstButton);
BeanTalk.text = phrases[Random.Range(0, phrases.Length)];
}
public void PlayGame()
{
SceneManager.LoadScene("Hub World", LoadSceneMode.Single);
}
public void Skins()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(skinsFirstButton);
2020-02-10 22:21:40 -05:00
BeanTalk.text = "WHAT DO I DO AGAIN?";
}
public void BackSkins()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(skinsBackButton);
BeanTalk.text = phrases[Random.Range(0, phrases.Length)];
}
public void Highscores()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(highscoreFirstButton);
2020-02-10 22:21:40 -05:00
BeanTalk.text = "GOOD JOB!";
}
public void BackHighscores()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(highscoreBackButton);
BeanTalk.text = phrases[Random.Range(0, phrases.Length)];
}
public void GameInfo()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(gameinfoFirstButton);
2020-02-10 22:21:40 -05:00
BeanTalk.text = "SO MANY BUTTONS!";
}
public void BackGameInfo()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(gameinfoBackButton);
BeanTalk.text = phrases[Random.Range(0, phrases.Length)];
}
public void Options()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(optionsFirstButton);
2020-02-10 22:21:40 -05:00
BeanTalk.text = "LOOK AT THOSE GRAPHIX!";
}
public void BackOptions()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(optionsBackButton);
BeanTalk.text = phrases[Random.Range(0, phrases.Length)];
}
public void QuitGame()
{
Application.Quit();
Debug.Log("QUIT");
}
}