Browse Source

Raycasting Bug fixed

Furkan Karakocaoglu 2 years ago
parent
commit
1250ad2170

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

@@ -169,14 +169,16 @@ public class CastingToObject : MonoBehaviour
         }
     }
 
+    private bool isMouseOverUI()
+    {
+        return EventSystem.current.IsPointerOverGameObject();
+    }
+
     // Update is called once per frame
     void FixedUpdate()
     {
-        if (Input.GetMouseButtonDown(0))
+        if (Input.GetMouseButtonDown(0) && !isMouseOverUI())
         {
-            if (EventSystem.current.currentSelectedGameObject != null)
-                return;
-
             var ray = currentCam.ScreenPointToRay(Input.mousePosition);
             if (Physics.Raycast(ray, out theObject, float.MaxValue, layer))
             {

+ 19 - 19
testumgebung/CrowdModelling/Assets/User_Study/Scenes/00_Playground.unity

@@ -665,7 +665,7 @@ GameObject:
   - component: {fileID: 110718692}
   - component: {fileID: 110718694}
   - component: {fileID: 110718693}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -2114,7 +2114,7 @@ GameObject:
   - component: {fileID: 422840834}
   - component: {fileID: 422840836}
   - component: {fileID: 422840835}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -2266,7 +2266,7 @@ GameObject:
   - component: {fileID: 471934970}
   - component: {fileID: 471934972}
   - component: {fileID: 471934971}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: HighDynamicLongWaiting
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -2498,7 +2498,7 @@ GameObject:
   - component: {fileID: 577667461}
   - component: {fileID: 577667463}
   - component: {fileID: 577667462}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -3005,7 +3005,7 @@ GameObject:
   m_Component:
   - component: {fileID: 662991576}
   - component: {fileID: 662991577}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Submit
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -3181,7 +3181,7 @@ GameObject:
   - component: {fileID: 682571683}
   - component: {fileID: 682571685}
   - component: {fileID: 682571684}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -3259,7 +3259,7 @@ GameObject:
   serializedVersion: 6
   m_Component:
   - component: {fileID: 700847358}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: ChangeView
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -3462,7 +3462,7 @@ GameObject:
   - component: {fileID: 730861553}
   - component: {fileID: 730861552}
   - component: {fileID: 730861551}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Button
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -4161,7 +4161,7 @@ GameObject:
   - component: {fileID: 920012126}
   - component: {fileID: 920012128}
   - component: {fileID: 920012127}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -5732,7 +5732,7 @@ GameObject:
   - component: {fileID: 1207195761}
   - component: {fileID: 1207195763}
   - component: {fileID: 1207195762}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -5956,7 +5956,7 @@ GameObject:
   - component: {fileID: 1271572820}
   - component: {fileID: 1271572822}
   - component: {fileID: 1271572821}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Selection Legend
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -6555,7 +6555,7 @@ GameObject:
   - component: {fileID: 1308121758}
   - component: {fileID: 1308121760}
   - component: {fileID: 1308121759}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -7344,7 +7344,7 @@ GameObject:
   - component: {fileID: 1438790947}
   - component: {fileID: 1438790949}
   - component: {fileID: 1438790948}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: LowDynamicLongWaiting
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -7781,7 +7781,7 @@ GameObject:
   - component: {fileID: 1594303656}
   - component: {fileID: 1594303657}
   - component: {fileID: 1594303658}
-  m_Layer: 16
+  m_Layer: 5
   m_Name: Slider
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -8276,7 +8276,7 @@ GameObject:
   - component: {fileID: 1763957187}
   - component: {fileID: 1763957189}
   - component: {fileID: 1763957188}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Explanation Static Heatmap
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -8578,7 +8578,7 @@ GameObject:
   - component: {fileID: 1788798480}
   - component: {fileID: 1788798482}
   - component: {fileID: 1788798481}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: LowDynamicShortWaiting
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -9524,7 +9524,7 @@ GameObject:
   - component: {fileID: 2031391630}
   - component: {fileID: 2031391632}
   - component: {fileID: 2031391631}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Text
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -9653,7 +9653,7 @@ GameObject:
   - component: {fileID: 2039409821}
   - component: {fileID: 2039409823}
   - component: {fileID: 2039409822}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: HighDynamicShortWaiting
   m_TagString: Untagged
   m_Icon: {fileID: 0}
@@ -9726,7 +9726,7 @@ GameObject:
   - component: {fileID: 2040555403}
   - component: {fileID: 2040555402}
   - component: {fileID: 2040555401}
-  m_Layer: 0
+  m_Layer: 5
   m_Name: Button
   m_TagString: Untagged
   m_Icon: {fileID: 0}

+ 1 - 1
testumgebung/CrowdModelling/Assets/User_Study/Scenes/12_Condition.unity

@@ -8268,7 +8268,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!224 &1763957187
 RectTransform:
   m_ObjectHideFlags: 0