소스 검색

Raycasting Bug half fixed

Furkan Karakocaoglu 2 년 전
부모
커밋
7fe2294cd9
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      testumgebung/CrowdModelling/Assets/Depictions_Years/Scripts/Logging/CastingToObject.cs

+ 4 - 0
testumgebung/CrowdModelling/Assets/Depictions_Years/Scripts/Logging/CastingToObject.cs

@@ -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))
             {