diff --git a/Assets/Scenes/Floor Level.unity b/Assets/Scenes/Floor Level.unity index bd30159..b0a0206 100644 --- a/Assets/Scenes/Floor Level.unity +++ b/Assets/Scenes/Floor Level.unity @@ -1179,6 +1179,8 @@ MonoBehaviour: ScoreText: {fileID: 1455233009} TimeText: {fileID: 0} LivesText: {fileID: 1368792133} + pauseFirstButton: {fileID: 223326611} + gameOverFirstButton: {fileID: 0} --- !u!114 &989087329 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2605,7 +2607,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Name: m_EditorClassIdentifier: - m_FirstSelected: {fileID: 223326611} + m_FirstSelected: {fileID: 0} m_sendNavigationEvents: 1 m_DragThreshold: 10 --- !u!4 &2032483826 diff --git a/Assets/Scenes/Hub World.unity b/Assets/Scenes/Hub World.unity index 4b85b78..63d4c3a 100644 --- a/Assets/Scenes/Hub World.unity +++ b/Assets/Scenes/Hub World.unity @@ -2944,10 +2944,10 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 0.990566, g: 0.990566, b: 0.990566, a: 0} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 0.23529412} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 0.20392157} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.4509804} m_SelectedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.4509804} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.4509804} m_ColorMultiplier: 1 m_FadeDuration: 0.1 m_SpriteState: @@ -4335,7 +4335,7 @@ MonoBehaviour: m_CancelButton: Pause m_InputActionsPerSecond: 10 m_RepeatDelay: 0.5 - m_ForceModuleActive: 1 + m_ForceModuleActive: 0 --- !u!114 &1398248577 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4348,7 +4348,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Name: m_EditorClassIdentifier: - m_FirstSelected: {fileID: 312387577} + m_FirstSelected: {fileID: 0} m_sendNavigationEvents: 1 m_DragThreshold: 10 --- !u!4 &1398248578 @@ -5161,6 +5161,8 @@ MonoBehaviour: ScoreText: {fileID: 2045279608} TimeText: {fileID: 13294516} LivesText: {fileID: 13294516} + pauseFirstButton: {fileID: 312387577} + gameOverFirstButton: {fileID: 745391730} --- !u!1 &1734965523 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/Main Menu.unity b/Assets/Scenes/Main Menu.unity index 43858ad..bd81796 100644 --- a/Assets/Scenes/Main Menu.unity +++ b/Assets/Scenes/Main Menu.unity @@ -225,6 +225,17 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 511552647} + m_MethodName: Skins + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!114 &68978049 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1436,8 +1447,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} + m_Mode: 4 + m_SelectOnUp: {fileID: 1856065825} m_SelectOnDown: {fileID: 0} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} @@ -1488,6 +1499,17 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 511552647} + m_MethodName: BackOptions + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!114 &393633553 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2124,6 +2146,11 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d303634fe1e2e0142bac77214c413b02, type: 3} m_Name: m_EditorClassIdentifier: + menuFirstButton: {fileID: 1417856269} + skinsFirstButton: {fileID: 1236659683} + optionsFirstButton: {fileID: 393633550} + skinsBackButton: {fileID: 68978046} + optionsBackButton: {fileID: 552329883} --- !u!1 &538255948 GameObject: m_ObjectHideFlags: 0 @@ -2302,6 +2329,17 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 511552647} + m_MethodName: Options + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!114 &552329886 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3545,7 +3583,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} m_Name: m_EditorClassIdentifier: - m_FirstSelected: {fileID: 1417856269} + m_FirstSelected: {fileID: 0} m_sendNavigationEvents: 1 m_DragThreshold: 10 --- !u!4 &985624425 @@ -3633,7 +3671,7 @@ Canvas: m_RenderMode: 0 m_Camera: {fileID: 0} m_PlaneDistance: 100 - m_PixelPerfect: 0 + m_PixelPerfect: 1 m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 @@ -4315,6 +4353,17 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 511552647} + m_MethodName: BackSkins + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!114 &1236659686 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4475,17 +4524,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} + m_SelectOnDown: {fileID: 1869152853} + m_SelectOnLeft: {fileID: 1555915346} m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_SelectedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5686275} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 @@ -5060,17 +5109,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 + m_Mode: 4 m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} + m_SelectOnDown: {fileID: 1869152853} m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} + m_SelectOnRight: {fileID: 1245062958} m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_SelectedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5686275} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 @@ -5743,17 +5792,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} + m_Mode: 4 + m_SelectOnUp: {fileID: 1869152853} + m_SelectOnDown: {fileID: 393633552} m_SelectOnLeft: {fileID: 0} m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_NormalColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_HighlightedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5686275} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5686275} + m_SelectedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5686275} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 @@ -5845,17 +5894,17 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Navigation: - m_Mode: 3 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} + m_Mode: 4 + m_SelectOnUp: {fileID: 1245062958} + m_SelectOnDown: {fileID: 1856065825} + m_SelectOnLeft: {fileID: 1555915346} m_SelectOnRight: {fileID: 0} m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_SelectedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5686275} m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 m_FadeDuration: 0.1 diff --git a/Assets/Scenes/Waypoint Race.unity b/Assets/Scenes/Waypoint Race.unity index c2b06ab..f614043 100644 --- a/Assets/Scenes/Waypoint Race.unity +++ b/Assets/Scenes/Waypoint Race.unity @@ -957,6 +957,8 @@ MonoBehaviour: ScoreText: {fileID: 428865310} TimeText: {fileID: 1037071376} LivesText: {fileID: 0} + pauseFirstButton: {fileID: 1040909057} + gameOverFirstButton: {fileID: 0} --- !u!114 &963355971 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/MainMenu.cs b/Assets/Scripts/MainMenu.cs index 764bbcd..e33f859 100644 --- a/Assets/Scripts/MainMenu.cs +++ b/Assets/Scripts/MainMenu.cs @@ -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(); diff --git a/Assets/Scripts/PauseMenu.cs b/Assets/Scripts/PauseMenu.cs index 5edcc61..f1574b4 100644 --- a/Assets/Scripts/PauseMenu.cs +++ b/Assets/Scripts/PauseMenu.cs @@ -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) {