I want to implement a custom LayoutManager, e.g. a HorizontalLayout. (Yes I know, that this already exists, but I want my own behaviour) So when I let my script calculate the width, that works. But now I want to adjust the width of one Element and let the script recalculate the width of the other elements accordingly, I run into the problem, that the width is "locked" because the script is calculating all the time. So I want to tell the script, that it should only recalculate for the elements which are not clicked on the layout for the moment. I hope something like this is possible.
1 Answer
\$\begingroup\$
\$\endgroup\$
You can use the UnityEditor.Selection class to determine which objects are selected.
For example, when iterating over child objects to determine whether to adjust their scale, you can test whether UnityEditor.Selection.Contains(thisChild)