docs.unity.cn
    Show / Hide Table of Contents

    Class LayoutRebuilder

    Wrapper class for managing layout rebuilding of CanvasElement.

    Inheritance
    Object
    LayoutRebuilder
    Namespace: UnityEngine.UI
    Syntax
    public class LayoutRebuilder : ICanvasElement

    Properties

    transform

    Declaration
    public Transform transform { get; }
    Property Value
    Type Description
    Transform
    Implements
    ICanvasElement.transform

    Methods

    Equals(Object)

    Does the passed rebuilder point to the same CanvasElement.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The other object to compare

    Returns
    Type Description
    Boolean

    Are they equal

    Overrides
    Object.Equals(Object)

    ForceRebuildLayoutImmediate(RectTransform)

    Forces an immediate rebuild of the layout element and child layout elements affected by the calculations.

    Declaration
    public static void ForceRebuildLayoutImmediate(RectTransform layoutRoot)
    Parameters
    Type Name Description
    RectTransform layoutRoot

    The layout element to perform the layout rebuild on.

    Remarks

    Normal use of the layout system should not use this method. Instead MarkLayoutForRebuild should be used instead, which triggers a delayed layout rebuild during the next layout pass. The delayed rebuild automatically handles objects in the entire layout hierarchy in the correct order, and prevents multiple recalculations for the same layout elements. However, for special layout calculation needs, ::ref::ForceRebuildLayoutImmediate can be used to get the layout of a sub-tree resolved immediately. This can even be done from inside layout calculation methods such as ILayoutController.SetLayoutHorizontal orILayoutController.SetLayoutVertical. Usage should be restricted to cases where multiple layout passes are unavaoidable despite the extra cost in performance.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    Object.GetHashCode()

    GraphicUpdateComplete()

    Declaration
    public void GraphicUpdateComplete()
    Implements
    ICanvasElement.GraphicUpdateComplete()

    IsDestroyed()

    Has the native representation of this LayoutRebuilder been destroyed?

    Declaration
    public bool IsDestroyed()
    Returns
    Type Description
    Boolean
    Implements
    ICanvasElement.IsDestroyed()

    LayoutComplete()

    Declaration
    public void LayoutComplete()
    Implements
    ICanvasElement.LayoutComplete()

    MarkLayoutForRebuild(RectTransform)

    Mark the given RectTransform as needing it's layout to be recalculated during the next layout pass.

    Declaration
    public static void MarkLayoutForRebuild(RectTransform rect)
    Parameters
    Type Name Description
    RectTransform rect

    Rect to rebuild.

    Rebuild(CanvasUpdate)

    Declaration
    public void Rebuild(CanvasUpdate executing)
    Parameters
    Type Name Description
    CanvasUpdate executing
    Implements
    ICanvasElement.Rebuild(CanvasUpdate)

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on 12 June 2023