Make it so you can press escape in any place in berrydash (almost any)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class AccountHandler : MonoBehaviour
|
||||
{
|
||||
@@ -98,4 +100,14 @@ public class AccountHandler : MonoBehaviour
|
||||
}
|
||||
foreach (CustomColorObject customColorObject in FindObjectsByType<CustomColorObject>(FindObjectsSortMode.None)) customColorObject.SetColor();
|
||||
}
|
||||
|
||||
async void Update()
|
||||
{
|
||||
if (Keyboard.current.escapeKey.wasPressedThisFrame)
|
||||
{
|
||||
if (accountChangePassword.gameObject.activeSelf || accountChangeUsername.gameObject.activeSelf || accountRefreshLogin.gameObject.activeSelf) SwitchPanel(0);
|
||||
else if (accountLogin.gameObject.activeSelf || accountRegister.gameObject.activeSelf) SwitchPanel(1);
|
||||
else await SceneManager.LoadSceneAsync("MainMenu");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user