|
@@ -1,6 +1,7 @@
|
|
|
using System.Linq;
|
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
|
+using UnityEngine.EventSystems;
|
|
|
using UnityEngine.AI;
|
|
|
|
|
|
public class CastingToObject : MonoBehaviour
|
|
@@ -173,6 +174,9 @@ public class CastingToObject : MonoBehaviour
|
|
|
{
|
|
|
if (Input.GetMouseButtonDown(0))
|
|
|
{
|
|
|
+ if (EventSystem.current.currentSelectedGameObject != null)
|
|
|
+ return;
|
|
|
+
|
|
|
var ray = currentCam.ScreenPointToRay(Input.mousePosition);
|
|
|
if (Physics.Raycast(ray, out theObject, float.MaxValue, layer))
|
|
|
{
|