Why PropertyDrawers shared same values?

Hello everyone,

I used PropertyDrawers to automatically display a list of skills on the inspector.
So, I have a ListSkillDrawer and a SkillDrawer.
SkillDrawer have some values needed to be saved for its own uses, like a popup index (to remember the position in the popup) or a foldout.

The problem is, when I change one of these values, it is saved in the SkillDrawer, then all drawers received the update.
So, I can easily assume that drawers are allocated once for all.
But what can we do if we want to brake this rule?

In my example, if we have many skills, one foldout will command all skills’s foldout.

Does someone have an answer?

I have an idea on how to do my stuff, but it a pretty ugly trick.
Here is my explanation.
I wrote the ListDrawer, so when I’m calling PropertyField to draw my children, I can send them an iterator by the label. Thus, SkillDrawers will saved popup’s index and fold in an array.

I found a potential/partial answer, each SerializedProperty has a public isExpanded bool member. This bool has a separate instance for every property, so in theory every property can have it’s own separate and independent foldout.

After all this time, never thought to solve this topic since I know now the solution.

There is an unique PropertyDrawer per field. Thus it is shared. End of the story.