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 {