Return to site

Load level intance inside blueprint

broken image
broken image

There are many 'not a Bug, but rather a feature by design' things, won't be fixed in current HorizontalOrVerticalLayoutGroup After long adventures and frustrations with UGUI, I can say with confidence that reading the source code helps better than official documentation.

broken image

I want to slightly expand the Sun-Pengfei's answer. Are there any better options, or is ForceUpdateCanvases the correct way to do it?

broken image

Canvas.ForceUpdateCanvases seems to work, but is there a better way to do this? I would have thought that calling the ILayoutGroup functions to update layout would work, but they don't do anything when I call them.

broken image

I've been searching for a way to force the layout groups to update immediately, so that I can perform layout-related calculations all at once and avoid the coroutine and ugly frame issues. This would frequently result in position and animation calculations being incorrect until I remembered 'ahh yep, got to do this in a coroutine, yield a frame, and then do these calculations.' This wouldn't be so bad, but it also results in an ugly single frame during gameplay where things are not positioned correctly - that yielded frame. For awhile, a pretty frequent 'gotcha' for me when working with Unity's new UI system is that items added to a layout group (such as HorizontalLayoutGroup, VerticalLayoutGroup, etc) are not immediately positioned within the layout group.

broken image