Skip to content

Layout Helpers

Ilia Petrov-Komotskii edited this page Oct 7, 2026 · 2 revisions

Helpers for RectTransform layout callbacks.

ManeUIBehaviour

UIBehaviour with a cached rectTransform (same idea as transform). Requires a RectTransform. Subclass this instead of reaching for GetComponent<RectTransform>() on every callback.

public class AmazingComponent : ManeUIBehaviour
{
    protected void Awake()
    {
        base.Awake();

        float rotationZ = transform.localRotation.eulerAngles.z;
        float positionX = rectTransform.anchoredPosition.x;
    }
}

RectTransformChangedCatcher

Forwards OnRectTransformDimensionsChange as a C# event. One per GameObject.

catcher.OnRectTransformDimensionsChanged += rt => Relayout(rt);

Add Component → Mane Tools → UI → RectTransformChanged Catcher.

Clone this wiki locally