Class GraphicRegistry
Registry which maps a Graphic to the canvas it belongs to.
Inherited Members
Namespace: UnityEngine.UI
Assembly: UnityEngine.UI.dll
Syntax
public class GraphicRegistry
Constructors
GraphicRegistry()
Declaration
protected GraphicRegistry()
Properties
instance
The singleton instance of the GraphicRegistry. Creates a new instance if it does not exist.
Declaration
public static GraphicRegistry instance { get; }
Property Value
Type | Description |
---|---|
GraphicRegistry |
Methods
DisableGraphicForCanvas(Canvas, Graphic)
Disables a Graphic from a Canvas, disabling this association from the registry.
Declaration
public static void DisableGraphicForCanvas(Canvas c, Graphic graphic)
Parameters
Type | Name | Description |
---|---|---|
Canvas | c | The Canvas to dissociate from the Graphic. |
Graphic | graphic | The Graphic to dissociate from the Canvas. |
DisableRaycastGraphicForCanvas(Canvas, Graphic)
Disables the raycast for a Graphic from a Canvas, disabling this association from the registry.
Declaration
public static void DisableRaycastGraphicForCanvas(Canvas c, Graphic graphic)
Parameters
Type | Name | Description |
---|---|---|
Canvas | c | The Canvas to dissociate from the Graphic. |
Graphic | graphic | The Graphic to dissociate from the Canvas. |
GetGraphicsForCanvas(Canvas)
Retrieves the list of Graphics associated with a Canvas.
Declaration
public static IList<Graphic> GetGraphicsForCanvas(Canvas canvas)
Parameters
Type | Name | Description |
---|---|---|
Canvas | canvas | The Canvas to search |
Returns
Type | Description |
---|---|
IList<Graphic> | Returns a list of Graphics. Returns an empty list if no Graphics are associated with the specified Canvas. |
GetRaycastableGraphicsForCanvas(Canvas)
Retrieves the list of Graphics that are raycastable and associated with a Canvas.
Declaration
public static IList<Graphic> GetRaycastableGraphicsForCanvas(Canvas canvas)
Parameters
Type | Name | Description |
---|---|---|
Canvas | canvas | The Canvas to search |
Returns
Type | Description |
---|---|
IList<Graphic> | Returns a list of Graphics. Returns an empty list if no Graphics are associated with the specified Canvas. |
RegisterGraphicForCanvas(Canvas, Graphic)
Associates a Graphic with a Canvas and stores this association in the registry.
Declaration
public static void RegisterGraphicForCanvas(Canvas c, Graphic graphic)
Parameters
Type | Name | Description |
---|---|---|
Canvas | c | The canvas being associated with the Graphic. |
Graphic | graphic | The Graphic being associated with the Canvas. |
RegisterRaycastGraphicForCanvas(Canvas, Graphic)
Associates a raycastable Graphic with a Canvas and stores this association in the registry.
Declaration
public static void RegisterRaycastGraphicForCanvas(Canvas c, Graphic graphic)
Parameters
Type | Name | Description |
---|---|---|
Canvas | c | The canvas being associated with the Graphic. |
Graphic | graphic | The Graphic being associated with the Canvas. |
UnregisterGraphicForCanvas(Canvas, Graphic)
Dissociates a Graphic from a Canvas, removing this association from the registry.
Declaration
public static void UnregisterGraphicForCanvas(Canvas c, Graphic graphic)
Parameters
Type | Name | Description |
---|---|---|
Canvas | c | The Canvas to dissociate from the Graphic. |
Graphic | graphic | The Graphic to dissociate from the Canvas. |
UnregisterRaycastGraphicForCanvas(Canvas, Graphic)
Dissociates a Graphic from a Canvas, removing this association from the registry.
Declaration
public static void UnregisterRaycastGraphicForCanvas(Canvas c, Graphic graphic)
Parameters
Type | Name | Description |
---|---|---|
Canvas | c | The Canvas to dissociate from the Graphic. |
Graphic | graphic | The Graphic to dissociate from the Canvas. |