Best practices for high performance when using FlexBuilder via script

The main thing to bear in mind when aiming for performance is that FlexBuilder will always default to "doing the right thing" -- which may be a lot slower than necessary. For instance: if you write a script that adds 100 FlexItems to a FlexContainer, FlexBuilder will automatically re-run the layout algorithm ... 100 times. ... Read more

Categories FAQ

How to draw an array of items in UIToolkit in UnityEditor

After a few years of working with UIToolkit, and continually deploying it in apps and trialling solutions from the community, I eventually arrived at this "simple" code example that appears to work in all versions of Unity from 2019 through 2021+. I'm using this in production, will update this post if I find new problems ... Read more

Problem: CACHE_STRATEGY is too agressive

When building flexible UI in Unity3D you may sometimes see this message on the Unity console: FlexBuilder: Your CACHE_STRATEGY is too aggressive! - Cache contained an object Unity had already destroyed TL;DR: quickest solution If you just want to make the warning go away then you can safely comment-out the line of code that produces ... Read more

Categories FAQ