From 6b01de0095dff5f85ddb87d8127de68996394c5e Mon Sep 17 00:00:00 2001 From: Hubert Mattusch Date: Fri, 15 Sep 2023 14:03:55 +0200 Subject: [PATCH] fix --- NEG/UI/UnityUi/MonoUiInputManger.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEG/UI/UnityUi/MonoUiInputManger.cs b/NEG/UI/UnityUi/MonoUiInputManger.cs index de79046..51ac5c6 100644 --- a/NEG/UI/UnityUi/MonoUiInputManger.cs +++ b/NEG/UI/UnityUi/MonoUiInputManger.cs @@ -55,9 +55,13 @@ namespace NEG.UI.UnityUi private void SetDirectionInput() { + if (EventSystem.current == null) + { + return; + } CurrentSelectionSource = SelectionSource.Direction; Cursor.visible = false; - if (EventSystem.current != null && EventSystem.current.currentSelectedGameObject == null) + if (EventSystem.current.currentSelectedGameObject == null) { EventSystem.current.SetSelectedGameObject(((MonoWindow)MonoUiManager.Instance.CurrentMainWindow).DefaultSelectedItem); return;