mackysoft / Unity-SerializeReferenceExtensions

Provide popup to specify the type of the field serialized by the [SerializeReference] attribute in the inspector.
https://qiita.com/makihiro_dev/items/26daeb3e5f176934bf0a
MIT License
770 stars 59 forks source link

[BUG] Data doesn't refresh When Nested #62

Closed xrchennaidev closed 2 months ago

xrchennaidev commented 3 months ago

What happened?

So when i nest any class or interface and have this attribute ,the data inside doesnt refresh when i add element to that list ,also it somehow changes the data of the previous element also in array or list .

BUg

When the above Array is serialize and you add 1 data and fill the info then click on plus to add 1 more element this new data which just got added doesnt refreshes also if you change the data in this one it also changes in first one,until you manually change type to null and back what you want.

XPool Version

1.3.1

Unity Version

2022.3.39f

xrchennaidev commented 3 months ago

https://github.com/user-attachments/assets/fb61f422-b180-4ffa-a2dc-bfeb5c517580

Refer the Video if you want

mackysoft commented 3 months ago

Hi. Am I correct in assuming that you are talking about the issue of copying instances when using arrays?

In case of that problem, the following solution is recommended, or use ReorderableList and initialize the instance when adding list elements. https://github.com/mackysoft/Unity-SerializeReferenceExtensions/issues/10

In the past, we have tried to monitor the addition of array elements in a SerializedProperty and initialize the added instance, but unfortunately, monitoring array elements in a SerializedProperty was difficult and we had to forgo it.

xrchennaidev commented 3 months ago

OK thanks, i'll try to add the naughty attribute solution and check if it works