Class UIFocus
Provides functionality to determine focus and bounds for UI elements within a composition layer.
Inherited Members
Namespace: Unity.XR.CompositionLayers .UIInteraction
Assembly: Unity.XR.CompositionLayers.UIInteraction.dll
Syntax
[ExecuteInEditMode]
public class UIFocus : MonoBehaviour
Properties
Canvas
Reference to the Canvas this element is attached to
Declaration
public Canvas Canvas { get; }
Property Value
Type | Description |
---|---|
Canvas |
CompositionLayer
Reference to the parent Composition Layer
Declaration
public CompositionLayer CompositionLayer { get; }
Property Value
Type | Description |
---|---|
Composition |
MeshCollider
Reference to the MeshCollider of the parent Composition Layer
Declaration
public MeshCollider MeshCollider { get; }
Property Value
Type | Description |
---|---|
Mesh |
RectTransform
Reference to this element's RectTransform
Declaration
public RectTransform RectTransform { get; }
Property Value
Type | Description |
---|---|
Rect |
Methods
GetBounds()
Determines the bounds of the element based on the type of element it is
Declaration
public Bounds GetBounds()
Returns
Type | Description |
---|---|
Bounds | The bounds of the type |
GetCanvasBounds()
Gets the bounds of the RectTransform in the layer's local space and scales it to the root meshCollider
Declaration
public Bounds GetCanvasBounds()
Returns
Type | Description |
---|---|
Bounds | The bounds of the RectTransform in the layer's local space |