mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-06 01:23:31 +08:00
3.0.8
Reverting to the previous World-Raycast method as it gave more accurate/expected results
This commit is contained in:
parent
27f6a6ca52
commit
6dfa4806ce
@ -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";
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user