C# Class UnityEditor.HandleUtility

Helper functions for Scene View style 3D GUI.

Afficher le fichier Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Private Properties

Свойство Type Description
ApplyDottedWireMaterial void
ApplyWireMaterial void
BeginHandles void
CalcRayPlaceOffset float
CameraNeedsToRenderIntoRT bool
DistanceToDiamond float
DistanceToDiamondInternal float
DistanceToRectangleInternal float
EndHandles void
FindNearestVertex bool
FindSelectionBase UnityEngine.GameObject
GetParametrization float
INTERNAL_CALL_CalcRayPlaceOffset float
INTERNAL_CALL_DistancePointBezier float
INTERNAL_CALL_Internal_FindNearestVertex bool
INTERNAL_CALL_Internal_PickClosestGO UnityEngine.GameObject
INTERNAL_CALL_Internal_PickRectObjects UnityEngine.GameObject[]
INTERNAL_CALL_IntersectRayMesh bool
InitHandleMaterials void
Internal_FindNearestVertex bool
Internal_PickClosestGO UnityEngine.GameObject
Internal_PickRectObjects UnityEngine.GameObject[]
Internal_Repaint void
Internal_SetHandleWireTextureIndex void
IntersectRayMesh bool
PickGameObject UnityEngine.GameObject
PickGameObject UnityEngine.GameObject
SetViewInfo void

Méthodes publiques

Méthode Description
AddControl ( int controlId, float distance ) : void

Record a distance measurement from a handle.

AddDefaultControl ( int controlId ) : void

Add the ID for a default control. This will be picked if nothing else is.

CalcLineTranslation ( Vector2 src, Vector2 dest, Vector3 srcPosition, Vector3 constraintDir ) : float

Map a mouse drag onto a movement along a line in 3D space.

ClosestPointToArc ( Vector3 center, Vector3 normal, Vector3 from, float angle, float radius ) : Vector3

Get the point on an arc (in 3D space) which is closest to the current mouse position.

ClosestPointToDisc ( Vector3 center, Vector3 normal, float radius ) : Vector3

Get the point on an disc (in 3D space) which is closest to the current mouse position.

ClosestPointToPolyLine ( ) : Vector3

Get the point on a polyline (in 3D space) which is closest to the current mouse position.

DistancePointBezier ( Vector3 point, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent ) : float

Calculate distance between a point and a Bezier curve.

DistancePointLine ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : float

Calculate distance between a point and a line.

DistancePointToLine ( Vector2 p, Vector2 a, Vector2 b ) : float

Distance from a point p in 2d to a line defined by two points a and b.

DistancePointToLineSegment ( Vector2 p, Vector2 a, Vector2 b ) : float

Distance from a point p in 2d to a line segment defined by two points a and b.

DistanceToArc ( Vector3 center, Vector3 normal, Vector3 from, float angle, float radius ) : float

Pixel distance from mouse pointer to a 3D section of a disc.

DistanceToCircle ( Vector3 position, float radius ) : float

Pixel distance from mouse pointer to camera facing circle.

DistanceToDisc ( Vector3 center, Vector3 normal, float radius ) : float

Pixel distance from mouse pointer to a 3D disc.

DistanceToLine ( Vector3 p1, Vector3 p2 ) : float

Pixel distance from mouse pointer to line.

DistanceToPolyLine ( ) : float

Pixel distance from mouse pointer to a polyline.

DistanceToRectangle ( Vector3 position, Quaternion rotation, float size ) : float

Pixel distance from mouse pointer to a rectangle on screen.

GUIPointToWorldRay ( Vector2 position ) : Ray

Convert 2D GUI position to a world space ray.

GetHandleSize ( Vector3 position ) : float

Get world space size of a manipulator handle at given position.

PickGameObject ( Vector2 position, GameObject ignore, int &materialIndex ) : GameObject
PickGameObject ( Vector2 position, bool selectPrefabRoot ) : GameObject

Pick game object closest to specified position.

PickGameObject ( Vector2 position, bool selectPrefabRoot, GameObject ignore ) : GameObject
PickGameObject ( Vector2 position, int &materialIndex ) : GameObject
PickRectObjects ( Rect rect ) : UnityEngine.GameObject[]

Pick GameObjects that lie within a specified screen rectangle.

PickRectObjects ( Rect rect, bool selectPrefabRootsOnly ) : UnityEngine.GameObject[]

PointOnLineParameter ( Vector3 point, Vector3 linePoint, Vector3 lineDirection ) : float

Returns the parameter for the projection of the point on the given line.

PopCamera ( Camera camera ) : void

Retrieve all camera settings.

ProjectPointLine ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : Vector3

Project point onto a line.

PushCamera ( Camera camera ) : void

Store all camera settings.

RaySnap ( Ray ray ) : object

Casts ray against the scene and report if an object lies in its path.

Repaint ( ) : void

Repaint the current view.

WorldPointToSizedRect ( Vector3 position, GUIContent content, GUIStyle style ) : Rect

Calculate a rectangle to display a 2D GUI element near a projected point in 3D space.

WorldToGUIPoint ( Vector3 world ) : Vector2

Convert world space point to a 2D GUI position.

Private Methods

Méthode Description
ApplyDottedWireMaterial ( ) : void
ApplyWireMaterial ( ) : void
BeginHandles ( ) : void
CalcRayPlaceOffset ( Transform objects, Vector3 normal ) : float
CameraNeedsToRenderIntoRT ( Camera camera ) : bool
DistanceToDiamond ( Vector3 position, Quaternion rotation, float size ) : float
DistanceToDiamondInternal ( Vector3 position, Quaternion rotation, float size, Vector2 mousePosition ) : float
DistanceToRectangleInternal ( Vector3 position, Quaternion rotation, Vector2 size ) : float
EndHandles ( ) : void
FindNearestVertex ( Vector2 guiPoint, Transform objectsToSearch, Vector3 &vertex ) : bool
FindSelectionBase ( GameObject go ) : GameObject
GetParametrization ( Vector2 x0, Vector2 x1, Vector2 x2 ) : float
INTERNAL_CALL_CalcRayPlaceOffset ( Transform objects, Vector3 &normal ) : float
INTERNAL_CALL_DistancePointBezier ( Vector3 &point, Vector3 &startPosition, Vector3 &endPosition, Vector3 &startTangent, Vector3 &endTangent ) : float
INTERNAL_CALL_Internal_FindNearestVertex ( Camera cam, Vector2 &screenPoint, Transform objectsToSearch, Transform ignoreObjects, Vector3 &vertex ) : bool
INTERNAL_CALL_Internal_PickClosestGO ( Camera cam, int layers, Vector2 &position, GameObject ignore, GameObject filter, int &materialIndex ) : GameObject
INTERNAL_CALL_Internal_PickRectObjects ( Camera cam, Rect &rect, bool selectPrefabRoots ) : UnityEngine.GameObject[]
INTERNAL_CALL_IntersectRayMesh ( Ray &ray, Mesh mesh, Matrix4x4 &matrix, RaycastHit &hit ) : bool
InitHandleMaterials ( ) : void
Internal_FindNearestVertex ( Camera cam, Vector2 screenPoint, Transform objectsToSearch, Transform ignoreObjects, Vector3 &vertex ) : bool
Internal_PickClosestGO ( Camera cam, int layers, Vector2 position, GameObject ignore, GameObject filter, int &materialIndex ) : GameObject
Internal_PickRectObjects ( Camera cam, Rect rect, bool selectPrefabRoots ) : UnityEngine.GameObject[]
Internal_Repaint ( ) : void
Internal_SetHandleWireTextureIndex ( int textureIndex ) : void
IntersectRayMesh ( Ray ray, Mesh mesh, Matrix4x4 matrix, RaycastHit &hit ) : bool
PickGameObject ( Vector2 position, GameObject ignore, GameObject filter, int &materialIndex ) : GameObject
PickGameObject ( Vector2 position, bool selectPrefabRoot, GameObject ignore, GameObject filter ) : GameObject
SetViewInfo ( Vector2 screenPosition ) : void

Method Details

AddControl() public static méthode

Record a distance measurement from a handle.

public static AddControl ( int controlId, float distance ) : void
controlId int
distance float
Résultat void

AddDefaultControl() public static méthode

Add the ID for a default control. This will be picked if nothing else is.

public static AddDefaultControl ( int controlId ) : void
controlId int
Résultat void

CalcLineTranslation() public static méthode

Map a mouse drag onto a movement along a line in 3D space.

public static CalcLineTranslation ( Vector2 src, Vector2 dest, Vector3 srcPosition, Vector3 constraintDir ) : float
src Vector2 The source point of the drag.
dest Vector2 The destination point of the drag.
srcPosition Vector3 The 3D position the dragged object had at src ray.
constraintDir Vector3 3D direction of constrained movement.
Résultat float

ClosestPointToArc() public static méthode

Get the point on an arc (in 3D space) which is closest to the current mouse position.

public static ClosestPointToArc ( Vector3 center, Vector3 normal, Vector3 from, float angle, float radius ) : Vector3
center Vector3
normal Vector3
from Vector3
angle float
radius float
Résultat Vector3

ClosestPointToDisc() public static méthode

Get the point on an disc (in 3D space) which is closest to the current mouse position.

public static ClosestPointToDisc ( Vector3 center, Vector3 normal, float radius ) : Vector3
center Vector3
normal Vector3
radius float
Résultat Vector3

ClosestPointToPolyLine() public static méthode

Get the point on a polyline (in 3D space) which is closest to the current mouse position.

public static ClosestPointToPolyLine ( ) : Vector3
Résultat Vector3

DistancePointBezier() public static méthode

Calculate distance between a point and a Bezier curve.

public static DistancePointBezier ( Vector3 point, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent ) : float
point Vector3
startPosition Vector3
endPosition Vector3
startTangent Vector3
endTangent Vector3
Résultat float

DistancePointLine() public static méthode

Calculate distance between a point and a line.

public static DistancePointLine ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : float
point Vector3
lineStart Vector3
lineEnd Vector3
Résultat float

DistancePointToLine() public static méthode

Distance from a point p in 2d to a line defined by two points a and b.

public static DistancePointToLine ( Vector2 p, Vector2 a, Vector2 b ) : float
p Vector2
a Vector2
b Vector2
Résultat float

DistancePointToLineSegment() public static méthode

Distance from a point p in 2d to a line segment defined by two points a and b.

public static DistancePointToLineSegment ( Vector2 p, Vector2 a, Vector2 b ) : float
p Vector2
a Vector2
b Vector2
Résultat float

DistanceToArc() public static méthode

Pixel distance from mouse pointer to a 3D section of a disc.

public static DistanceToArc ( Vector3 center, Vector3 normal, Vector3 from, float angle, float radius ) : float
center Vector3
normal Vector3
from Vector3
angle float
radius float
Résultat float

DistanceToCircle() public static méthode

Pixel distance from mouse pointer to camera facing circle.

public static DistanceToCircle ( Vector3 position, float radius ) : float
position Vector3
radius float
Résultat float

DistanceToDisc() public static méthode

Pixel distance from mouse pointer to a 3D disc.

public static DistanceToDisc ( Vector3 center, Vector3 normal, float radius ) : float
center Vector3
normal Vector3
radius float
Résultat float

DistanceToLine() public static méthode

Pixel distance from mouse pointer to line.

public static DistanceToLine ( Vector3 p1, Vector3 p2 ) : float
p1 Vector3
p2 Vector3
Résultat float

DistanceToPolyLine() public static méthode

Pixel distance from mouse pointer to a polyline.

public static DistanceToPolyLine ( ) : float
Résultat float

DistanceToRectangle() public static méthode

Pixel distance from mouse pointer to a rectangle on screen.

public static DistanceToRectangle ( Vector3 position, Quaternion rotation, float size ) : float
position Vector3
rotation UnityEngine.Quaternion
size float
Résultat float

GUIPointToWorldRay() public static méthode

Convert 2D GUI position to a world space ray.

public static GUIPointToWorldRay ( Vector2 position ) : Ray
position Vector2
Résultat UnityEngine.Ray

GetHandleSize() public static méthode

Get world space size of a manipulator handle at given position.

public static GetHandleSize ( Vector3 position ) : float
position Vector3 The position of the handle in 3d space.
Résultat float

PickGameObject() public static méthode

public static PickGameObject ( Vector2 position, GameObject ignore, int &materialIndex ) : GameObject
position Vector2
ignore UnityEngine.GameObject
materialIndex int
Résultat UnityEngine.GameObject

PickGameObject() public static méthode

Pick game object closest to specified position.

public static PickGameObject ( Vector2 position, bool selectPrefabRoot ) : GameObject
position Vector2
selectPrefabRoot bool Select prefab.
Résultat UnityEngine.GameObject

PickGameObject() public static méthode

public static PickGameObject ( Vector2 position, bool selectPrefabRoot, GameObject ignore ) : GameObject
position Vector2
selectPrefabRoot bool
ignore UnityEngine.GameObject
Résultat UnityEngine.GameObject

PickGameObject() public static méthode

public static PickGameObject ( Vector2 position, int &materialIndex ) : GameObject
position Vector2
materialIndex int
Résultat UnityEngine.GameObject

PickRectObjects() public static méthode

Pick GameObjects that lie within a specified screen rectangle.

public static PickRectObjects ( Rect rect ) : UnityEngine.GameObject[]
rect UnityEngine.Rect An screen rectangle specified with pixel coordinates.
Résultat UnityEngine.GameObject[]

PickRectObjects() public static méthode

public static PickRectObjects ( Rect rect, bool selectPrefabRootsOnly ) : UnityEngine.GameObject[]
rect UnityEngine.Rect
selectPrefabRootsOnly bool
Résultat UnityEngine.GameObject[]

PointOnLineParameter() public static méthode

Returns the parameter for the projection of the point on the given line.

public static PointOnLineParameter ( Vector3 point, Vector3 linePoint, Vector3 lineDirection ) : float
point Vector3
linePoint Vector3
lineDirection Vector3
Résultat float

PopCamera() public static méthode

Retrieve all camera settings.

public static PopCamera ( Camera camera ) : void
camera UnityEngine.Camera
Résultat void

ProjectPointLine() public static méthode

Project point onto a line.

public static ProjectPointLine ( Vector3 point, Vector3 lineStart, Vector3 lineEnd ) : Vector3
point Vector3
lineStart Vector3
lineEnd Vector3
Résultat Vector3

PushCamera() public static méthode

Store all camera settings.

public static PushCamera ( Camera camera ) : void
camera UnityEngine.Camera
Résultat void

RaySnap() public static méthode

Casts ray against the scene and report if an object lies in its path.

public static RaySnap ( Ray ray ) : object
ray UnityEngine.Ray
Résultat object

Repaint() public static méthode

Repaint the current view.

public static Repaint ( ) : void
Résultat void

WorldPointToSizedRect() public static méthode

Calculate a rectangle to display a 2D GUI element near a projected point in 3D space.

public static WorldPointToSizedRect ( Vector3 position, GUIContent content, GUIStyle style ) : Rect
position Vector3 The world-space position to use.
content UnityEngine.GUIContent The content to make room for.
style UnityEngine.GUIStyle The style to use. The style's alignment.
Résultat UnityEngine.Rect

WorldToGUIPoint() public static méthode

Convert world space point to a 2D GUI position.

public static WorldToGUIPoint ( Vector3 world ) : Vector2
world Vector3 Point in world space.
Résultat Vector2