From 6dfa4806ce139fb5c553ba422ea8411f68a1df16 Mon Sep 17 00:00:00 2001 From: sinaioutlander <49360850+sinaioutlander@users.noreply.github.com> Date: Sat, 12 Dec 2020 23:24:44 +1100 Subject: [PATCH] 3.0.8 Reverting to the previous World-Raycast method as it gave more accurate/expected results --- src/ExplorerCore.cs | 2 +- src/Inspectors/MouseInspector.cs | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 4b3ce4e..123f90a 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -16,7 +16,7 @@ namespace UnityExplorer public class ExplorerCore { public const string NAME = "UnityExplorer"; - public const string VERSION = "3.0.6"; + public const string VERSION = "3.0.8"; public const string AUTHOR = "Sinai"; public const string GUID = "com.sinai.unityexplorer"; public const string EXPLORER_FOLDER = @"Mods\UnityExplorer"; diff --git a/src/Inspectors/MouseInspector.cs b/src/Inspectors/MouseInspector.cs index 55edf94..4c19625 100644 --- a/src/Inspectors/MouseInspector.cs +++ b/src/Inspectors/MouseInspector.cs @@ -109,21 +109,12 @@ namespace UnityExplorer.Inspectors internal static void RaycastWorld(Vector2 mousePos) { var ray = UnityHelpers.MainCamera.ScreenPointToRay(mousePos); - var casts = Physics.RaycastAll(ray, 1000f); + Physics.Raycast(ray, out RaycastHit hit, 1000f); - if (casts.Length > 0) + if (hit.transform) { - foreach (var cast in casts) - { - if (cast.transform) - { - var obj = cast.transform.gameObject; - - OnHitGameObject(obj); - - break; - } - } + var obj = hit.transform.gameObject; + OnHitGameObject(obj); } else {