Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Layout events

Events that occur when the layout engine changes the layout of an element.
Read time 1 minuteLast updated a month ago

GeometryChangedEvent
is currently the only layout event.
The base class for
GeometryChangedEvent
is the EventBase class.
The following table describes the layout event and its propagation phases:

Event

Description

Trickles down

Bubbles up

Cancellable

GeometryChangedEventSent when the position or the dimensions of an element changes.

Unique properties

oldRect
: The former position and dimensions of the element.
newRect
: The new position and dimensions of the element.

GeometryChangedEvent

The
GeometryChangedEvent
is sent when either the position or the dimensions of an element changes. Events of this type are only sent to the event target.
It's important to unregister from the
GeometryChangedEvent
event after you receive your callback, as additional layout changes will trigger the callback again.
target
: The element with a new geometry.

Additional resources