Have controller support fully working for current main menu and halfway functional for all pause screens

This commit is contained in:
Gregory Campbell
2020-01-27 21:34:58 -05:00
parent bb13bb930e
commit 7436ca32c9
6 changed files with 129 additions and 29 deletions
+37
View File
@@ -2,15 +2,52 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;
public class MainMenu : MonoBehaviour
{
public GameObject menuFirstButton;
public GameObject skinsFirstButton;
public GameObject optionsFirstButton;
public GameObject skinsBackButton;
public GameObject optionsBackButton;
void Start()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(menuFirstButton);
}
public void PlayGame()
{
SceneManager.LoadScene("Hub World", LoadSceneMode.Single);
}
public void Skins()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(skinsFirstButton);
}
public void BackSkins()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(skinsBackButton);
}
public void Options()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(optionsFirstButton);
}
public void BackOptions()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(optionsBackButton);
}
public void QuitGame()
{
Application.Quit();