docs.unity.cn
    Show / Hide Table of Contents

    Class CanvasUpdateRegistry

    A place where CanvasElements can register themselves for rebuilding.

    Inheritance
    Object
    CanvasUpdateRegistry
    Namespace: UnityEngine.UI
    Syntax
    public class CanvasUpdateRegistry

    Constructors

    CanvasUpdateRegistry()

    Declaration
    protected CanvasUpdateRegistry()

    Properties

    instance

    Get the singleton registry instance.

    Declaration
    public static CanvasUpdateRegistry instance { get; }
    Property Value
    Type Description
    CanvasUpdateRegistry

    Methods

    DisableCanvasElementForRebuild(ICanvasElement)

    Disable the given element from both the graphic and the layout rebuild lists.

    Declaration
    public static void DisableCanvasElementForRebuild(ICanvasElement element)
    Parameters
    Type Name Description
    ICanvasElement element

    IsRebuildingGraphics()

    Are graphics currently being rebuild.

    Declaration
    public static bool IsRebuildingGraphics()
    Returns
    Type Description
    Boolean

    True if the rebuild loop is CanvasUpdate.PreRender or CanvasUpdate.Render

    IsRebuildingLayout()

    Are graphics layouts currently being calculated..

    Declaration
    public static bool IsRebuildingLayout()
    Returns
    Type Description
    Boolean

    True if the rebuild loop is CanvasUpdate.Prelayout, CanvasUpdate.Layout or CanvasUpdate.Postlayout

    RegisterCanvasElementForGraphicRebuild(ICanvasElement)

    Try and add the given element to the rebuild list. Will not return if successfully added.

    Declaration
    public static void RegisterCanvasElementForGraphicRebuild(ICanvasElement element)
    Parameters
    Type Name Description
    ICanvasElement element

    The element that is needing rebuilt.

    RegisterCanvasElementForLayoutRebuild(ICanvasElement)

    Try and add the given element to the layout rebuild list. Will not return if successfully added.

    Declaration
    public static void RegisterCanvasElementForLayoutRebuild(ICanvasElement element)
    Parameters
    Type Name Description
    ICanvasElement element

    The element that is needing rebuilt.

    TryRegisterCanvasElementForGraphicRebuild(ICanvasElement)

    Try and add the given element to the rebuild list.

    Declaration
    public static bool TryRegisterCanvasElementForGraphicRebuild(ICanvasElement element)
    Parameters
    Type Name Description
    ICanvasElement element

    The element that is needing rebuilt.

    Returns
    Type Description
    Boolean

    True if the element was successfully added to the rebuilt list. False if either already inside a Graphic Update loop OR has already been added to the list.

    TryRegisterCanvasElementForLayoutRebuild(ICanvasElement)

    Try and add the given element to the layout rebuild list.

    Declaration
    public static bool TryRegisterCanvasElementForLayoutRebuild(ICanvasElement element)
    Parameters
    Type Name Description
    ICanvasElement element

    The element that is needing rebuilt.

    Returns
    Type Description
    Boolean

    True if the element was successfully added to the rebuilt list. False if either already inside a Graphic Update loop OR has already been added to the list.

    UnRegisterCanvasElementForRebuild(ICanvasElement)

    Remove the given element from both the graphic and the layout rebuild lists.

    Declaration
    public static void UnRegisterCanvasElementForRebuild(ICanvasElement element)
    Parameters
    Type Name Description
    ICanvasElement element
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 12 June 2023