fix():修复重启时花屏效果未关闭的BUG
This commit is contained in:
@@ -27,50 +27,32 @@ namespace UI
|
||||
{
|
||||
base.Start();
|
||||
inputManager = InputManager.Instance;
|
||||
inputManager.Input.Player.Setting.performed += (ctx) => { UIManager.Instance.SwitchUI<SettingViewer>(); };
|
||||
inputManager.Input.Player.Setting.performed += OnSettingOnperformed;
|
||||
}
|
||||
|
||||
private void OnSettingOnperformed(InputAction.CallbackContext ctx)
|
||||
{
|
||||
UIManager.Instance.SwitchUI<SettingViewer>();
|
||||
}
|
||||
|
||||
private void OnReloadButtonClicked()
|
||||
{
|
||||
GameManager.Instance.ReStartGame();
|
||||
ContentText.text = "循环次数:" + GameDataManager.Instance.TotalLoopCount.ToString();
|
||||
inputManager.SetCursorState(false, CursorLockMode.Locked);
|
||||
inputManager.SetInputForLook(true);
|
||||
inputManager.SetInputForMove(true);
|
||||
StartCoroutine(GameManager.Instance.ReStartGame());
|
||||
}
|
||||
|
||||
private void RegisterInput(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if (!isActiveAndEnabled)
|
||||
{
|
||||
Show();
|
||||
inputManager.SetCursorState(true, CursorLockMode.Confined);
|
||||
inputManager.SetInputForLook(false);
|
||||
inputManager.SetInputForMove(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Hide();
|
||||
inputManager.SetCursorState(false, CursorLockMode.Locked);
|
||||
inputManager.SetInputForLook(true);
|
||||
inputManager.SetInputForMove(true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
ContentText.text = "循环次数:" + GameDataManager.Instance.TotalLoopCount.ToString();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
inputManager.Input.Player.Setting.performed -= OnSettingOnperformed;
|
||||
}
|
||||
|
||||
public override void Hide()
|
||||
{
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
inputManager.Input.Player.Setting.performed -= RegisterInput;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user