Class UIHandle
Custom gizmo creator attached to every UI element under a Composition UI Layer Handles position, rotation, and scale calculations to draw Gizmos
Inherited Members
Namespace: Unity.XR.CompositionLayers .UIInteraction
Assembly: Unity.XR.CompositionLayers.UIInteraction.dll
Syntax
[ExecuteInEditMode]
public class UIHandle : MonoBehaviour
Properties
Canvas
Reference to the Canvas this element is attached to
Declaration
public Canvas Canvas { get; }
Property Value
Type | Description |
---|---|
Canvas |
CompositionLayerTransform
Reference to the parent Composition Layer's Transform
Declaration
public Transform CompositionLayerTransform { get; }
Property Value
Type | Description |
---|---|
Transform |
RectTransform
Reference to this element's RectTransform
Declaration
public RectTransform RectTransform { get; }
Property Value
Type | Description |
---|---|
Rect |
Methods
GetHandlePosition()
Calculates the position of the RectTransform in the layer's local space
Declaration
public Vector3 GetHandlePosition()
Returns
Type | Description |
---|---|
Vector3 | The position of the RectTransform in the layer's local space |
GetHandleRotation()
Calculates the rotation of the RectTransform in the layer's local space
Declaration
public Quaternion GetHandleRotation()
Returns
Type | Description |
---|---|
Quaternion | The RectTransform's rotation |
GetHandleScale()
Calculates the scale of the RectTransform in the layer's local space
Declaration
public Vector3 GetHandleScale()
Returns
Type | Description |
---|---|
Vector3 | The RectTransform's scale |
SetPosition(Vector3)
Sets the position of the UI handle.
Declaration
public void SetPosition(Vector3 worldPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldPosition | The position in world space. |
SetRectPosition(Vector3)
Sets the position of the RectTransform
Declaration
public void SetRectPosition(Vector3 worldPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldPosition | The location in World Space |
Remarks
Typically called with a return value from Handles.PositionHandle, Handles.RotationHandle, or Handles.ScaleHandle