static private Internal_PickClosestGO ( |
||
cam | ||
layers | int | |
position | Vector2 | |
ignore | ||
filter | ||
materialIndex | int | |
return |
public static GameObject PickGameObject(Vector2 position, out int materialIndex) { Camera current = Camera.current; int cullingMask = current.cullingMask; position = GUIClip.Unclip(position); position.y = (float)Screen.height - position.y - current.pixelRect.yMin; return(HandleUtility.Internal_PickClosestGO(current, cullingMask, position, out materialIndex)); }
internal static GameObject PickGameObject(Vector2 position, GameObject[] ignore, GameObject[] filter, out int materialIndex) { Camera current = Camera.current; int cullingMask = current.cullingMask; position = GUIClip.Unclip(position); position = EditorGUIUtility.PointsToPixels(position); position.y = (float)Screen.height - position.y - current.pixelRect.yMin; return(HandleUtility.Internal_PickClosestGO(current, cullingMask, position, ignore, filter, out materialIndex)); }
internal static GameObject PickGameObjectDelegated(Vector2 position, GameObject[] ignore, GameObject[] filter, out int materialIndex) { Camera current = Camera.current; int cullingMask = current.cullingMask; position = GUIClip.Unclip(position); position = EditorGUIUtility.PointsToPixels(position); position.y = (float)Screen.height - position.y - current.pixelRect.yMin; materialIndex = -1; GameObject gameObject = null; if (HandleUtility.pickClosestGameObjectDelegate != null) { gameObject = HandleUtility.pickClosestGameObjectDelegate(current, cullingMask, position, ignore, filter, out materialIndex); } if (gameObject == null) { gameObject = HandleUtility.Internal_PickClosestGO(current, cullingMask, position, ignore, filter, out materialIndex); } return gameObject; }