Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 6dfa480

Browse files
committed
3.0.8
Reverting to the previous World-Raycast method as it gave more accurate/expected results
1 parent 27f6a6c commit 6dfa480

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

src/ExplorerCore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace UnityExplorer
1616
public class ExplorerCore
1717
{
1818
public const string NAME = "UnityExplorer";
19-
public const string VERSION = "3.0.6";
19+
public const string VERSION = "3.0.8";
2020
public const string AUTHOR = "Sinai";
2121
public const string GUID = "com.sinai.unityexplorer";
2222
public const string EXPLORER_FOLDER = @"Mods\UnityExplorer";

src/Inspectors/MouseInspector.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,12 @@ internal static void OnHitGameObject(GameObject obj)
109109
internal static void RaycastWorld(Vector2 mousePos)
110110
{
111111
var ray = UnityHelpers.MainCamera.ScreenPointToRay(mousePos);
112-
var casts = Physics.RaycastAll(ray, 1000f);
112+
Physics.Raycast(ray, out RaycastHit hit, 1000f);
113113

114-
if (casts.Length > 0)
114+
if (hit.transform)
115115
{
116-
foreach (var cast in casts)
117-
{
118-
if (cast.transform)
119-
{
120-
var obj = cast.transform.gameObject;
121-
122-
OnHitGameObject(obj);
123-
124-
break;
125-
}
126-
}
116+
var obj = hit.transform.gameObject;
117+
OnHitGameObject(obj);
127118
}
128119
else
129120
{

0 commit comments

Comments
 (0)