Added scene transition.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem.UI;
|
||||
|
||||
public class UIManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private InputSystemUIInputModule _inputSystemUIInputModule;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _menuPanelUI;
|
||||
[SerializeField]
|
||||
@@ -11,6 +15,7 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
private void InitUI()
|
||||
{
|
||||
_menuPanelUI.SetActive(false);
|
||||
_successPanel.SetActive(false);
|
||||
_gameOverPanel.SetActive(false);
|
||||
}
|
||||
@@ -20,6 +25,21 @@ public class UIManager : MonoBehaviour
|
||||
InitUI();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_inputSystemUIInputModule.cancel.action.performed += ctx => OnCancelAction();
|
||||
}
|
||||
|
||||
public void SetMenuPanelActive(bool value)
|
||||
{
|
||||
_menuPanelUI.SetActive(value);
|
||||
}
|
||||
|
||||
private void OnCancelAction()
|
||||
{
|
||||
SetMenuPanelActive(!_menuPanelUI.activeSelf);
|
||||
}
|
||||
|
||||
public void ShowSuccessPanel()
|
||||
{
|
||||
_successPanel.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user