Skip to content

Commit

Permalink
Update TouchInputManager.cs
Browse files Browse the repository at this point in the history
- fix EventSystem null
  • Loading branch information
DucNV2000 committed Jul 9, 2024
1 parent e25eaac commit 5b3b5fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core/TouchInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class TouchInputManager : MonoBehaviour

private void Update()
{
if (ignoreUI)
if (ignoreUI && EventSystem.current != null)
{
if (Input.touchCount > 0 && EventSystem.current.currentSelectedGameObject == null)
{
Expand All @@ -50,7 +50,7 @@ private void Update()
#if UNITY_EDITOR
if (useMouse)
{
if (ignoreUI)
if (ignoreUI && EventSystem.current != null)
{
if (EventSystem.current.currentSelectedGameObject == null)
{
Expand Down

0 comments on commit 5b3b5fd

Please sign in to comment.