0
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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)

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.