Skip to content

Commit 5b3b5fd

Browse files
committed
Update TouchInputManager.cs
- fix EventSystem null
1 parent e25eaac commit 5b3b5fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Core/TouchInputManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class TouchInputManager : MonoBehaviour
3333

3434
private void Update()
3535
{
36-
if (ignoreUI)
36+
if (ignoreUI && EventSystem.current != null)
3737
{
3838
if (Input.touchCount > 0 && EventSystem.current.currentSelectedGameObject == null)
3939
{
@@ -50,7 +50,7 @@ private void Update()
5050
#if UNITY_EDITOR
5151
if (useMouse)
5252
{
53-
if (ignoreUI)
53+
if (ignoreUI && EventSystem.current != null)
5454
{
5555
if (EventSystem.current.currentSelectedGameObject == null)
5656
{

0 commit comments

Comments
 (0)