Search Unity

LayoutGroup OnLayout?

Discussion in 'Immediate Mode GUI (IMGUI)' started by CDF, Oct 2, 2014.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Hi, just wondering if it's possible to catch an event after layout has been performed on a LayoutGroup?

    seems that layout isn't calculated immediately, or I can't find a way to force a layout.

    I'm adding children dynamically to a HorizontalLayoutGroup object, which is then controlled by a ScrollRect.
    I need to size the group to fit the size of the children so the scroll rect can operate correctly.

    Using a single frame coroutine seems to work, but wondering if there's a better way...