Class LayoutRebuilder
Wrapper class for managing layout rebuilding of CanvasElement.
Implements
Inherited Members
Namespace: UnityEngine.UI
Assembly: UnityEngine.UI.dll
Syntax
public class LayoutRebuilder : ICanvasElement
Properties
transform
Get the transform associated with the ICanvasElement.
Declaration
public Transform transform { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
bool | Are they equal |
Overrides
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 |
---|---|
int |
Overrides
GraphicUpdateComplete()
Callback sent when this ICanvasElement has completed Graphic rebuild.
Declaration
public void GraphicUpdateComplete()
IsDestroyed()
Has the native representation of this LayoutRebuilder been destroyed?
Declaration
public bool IsDestroyed()
Returns
Type | Description |
---|---|
bool |
LayoutComplete()
Callback sent when this ICanvasElement has completed layout.
Declaration
public void 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)
Rebuild the element for the given stage.
Declaration
public void Rebuild(CanvasUpdate executing)
Parameters
Type | Name | Description |
---|---|---|
CanvasUpdate | executing | The current CanvasUpdate stage being rebuild. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |