Have controller support fully working for current main menu and halfway functional for all pause screens
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using TMPro;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class PauseMenu : MonoBehaviour
|
||||
{
|
||||
@@ -17,6 +18,9 @@ public class PauseMenu : MonoBehaviour
|
||||
public TextMeshProUGUI TimeText;
|
||||
public TextMeshProUGUI LivesText;
|
||||
|
||||
public GameObject pauseFirstButton;
|
||||
public GameObject gameOverFirstButton;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
@@ -59,6 +63,8 @@ public class PauseMenu : MonoBehaviour
|
||||
pauseMenuUI.SetActive(true);
|
||||
Time.timeScale = 0f;
|
||||
GameIsPaused = true;
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
EventSystem.current.SetSelectedGameObject(pauseFirstButton);
|
||||
}
|
||||
|
||||
void GameOver()
|
||||
@@ -69,6 +75,8 @@ public class PauseMenu : MonoBehaviour
|
||||
gameOverUI.SetActive(true);
|
||||
Time.timeScale = 0f;
|
||||
GameIsPaused = true;
|
||||
EventSystem.current.SetSelectedGameObject(null);
|
||||
EventSystem.current.SetSelectedGameObject(gameOverFirstButton);
|
||||
|
||||
if(FloorLevel.gameOver == true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user