It work when build like this img.
But in editor it don’t work.
It happen on every layout that need to use ForceRebuildLayoutImmediate.
What i have try.
Reinstall Unity 2017.2
Closing Game Window
Closing Scene Window
Use another resolution.
All above don’t work anymore.
Confirming it doesn’t work on OSX in Unity 2017.2.0f3 too. Our code was relying in this API and now is broken. Have you filed the issue on Unity bug tracker? as it looks like a regression.
In our case the issue was not ForceRebuildLayoutImmediate itself, but rather fact that with Unity 2017.2 the OnDisable() implementation of LayoutGroup now explicitly restores child properties via DrivenRectTransformTracker.Clear(true).
It means that scenario:
a) temporary enable LayoutGroup,
b) force rebuild so layout updates chidren,
c) disable layout group
d) expect child objects to remain laid-out
no longer works - children are restored like they were never laid-out. Solved by subclassing from HorizontalLayoutGroup and overriding OnDisable() to call DrivenRectTransformTracker.Clear(false) instead - this restores old behavior.
Its a pity that release notes and migration guidelines say nothing about this change in behavior.