Table of Contents

Class SimpleLayoutRebuilder

Namespace
Fallencake.UI
Assembly
Fallencake.UI.dll

Component that provides methods to force rebuild layout groups when child elements change size. Solves the issue where layout groups don't update their arrangement when child elements resize.

public class SimpleLayoutRebuilder : MonoBehaviour
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
SimpleLayoutRebuilder

Methods

RebuildLayout()

Forces immediate rebuild of the layout for this RectTransform and its children. This method should be called when child elements change size and layout doesn't update automatically.

public void RebuildLayout()

RebuildLayoutDelayed(float)

Rebuilds layout with a specified delay. Useful when multiple changes happen in quick succession.

public void RebuildLayoutDelayed(float delay = -1)

Parameters

delay float

Delay in seconds before rebuilding

RebuildLayoutForTarget(GameObject)

Rebuilds layout for a specific GameObject.

public static void RebuildLayoutForTarget(GameObject target)

Parameters

target GameObject

Target GameObject to rebuild

RebuildLayoutForTarget(RectTransform)

Rebuilds layout for a specific RectTransform.

public static void RebuildLayoutForTarget(RectTransform target)

Parameters

target RectTransform

Target RectTransform to rebuild

RebuildLayoutNextFrame()

Schedules a layout rebuild on the next frame.

public void RebuildLayoutNextFrame()

RefreshLayoutComponents()

Refreshes cached layout components. Call this if layout components are added/removed at runtime.

public void RefreshLayoutComponents()