fix : error in the menu and rename files
This commit is contained in:
@@ -31,6 +31,19 @@ public class RetroMainMenuUI : MonoBehaviour
|
|||||||
|
|
||||||
BuildMenu();
|
BuildMenu();
|
||||||
EnsureEventSystem();
|
EnsureEventSystem();
|
||||||
|
|
||||||
|
UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDestroy()
|
||||||
|
{
|
||||||
|
UnityEngine.SceneManagement.SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
|
||||||
|
{
|
||||||
|
// Check again when the scene finishes loading to remove any baked-in duplicate EventSystems
|
||||||
|
EnsureEventSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LateUpdate()
|
private void LateUpdate()
|
||||||
@@ -316,8 +329,7 @@ public class RetroMainMenuUI : MonoBehaviour
|
|||||||
|
|
||||||
private static void EnsureEventSystem()
|
private static void EnsureEventSystem()
|
||||||
{
|
{
|
||||||
EventSystem[] allEventSystems = Object.FindObjectsByType<EventSystem>(FindObjectsSortMode.None);
|
EventSystem[] allEventSystems = Object.FindObjectsByType<EventSystem>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||||
|
|
||||||
EventSystem eventSystem;
|
EventSystem eventSystem;
|
||||||
if (allEventSystems.Length == 0)
|
if (allEventSystems.Length == 0)
|
||||||
{
|
{
|
||||||
2
Assets/Code/Scripts/UI/MainMenuUI.cs.meta
Normal file
2
Assets/Code/Scripts/UI/MainMenuUI.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 297533e46238b814989fcd5d46cf8927
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: fa612753289203548aa7ed790c42847e
|
|
||||||
Reference in New Issue
Block a user