Reordering a list of items containing a LocalizedString swaps everything except the LocalizedString

We suffered from this bug today, and seems to happen only with LocalizedStrings.

Create a simple serializable class:

    [System.Serializable]
    public class MyLocalizedClass
    {
        public int Id;
        public LocalizedString Text;
    }

Add in any monobehaviour a field of type List.

In editor, add two items in the list, one with Id 0 and a LocalizedString (let’s say “A”), and the other with Id 1 and another LocalizedString (let’s say “B”).

Current list:
0, “A”
1, “B”

Reorder it in the editor.

Expected result:
1, “B”
0, “A”

Current result:
1, “A”
0, “B”

All the fields of the serializable class changed, except the LocalizedString ones.

Editor version: 2020.2.0b1

Thank you

Hi,
Could you please file a bug report?

Done, case number 1286120.

I’m curious to know if it’s something related to the editor or the localization package :slight_smile:

Thank you, meanwhile!

1 Like

I suspect its the package. We do some caching in our property drawers so its probably just that.

1 Like

Oh, shoot, you are right!
Deselecting and reselecting the container again actually shows the correct values.

This makes it at least somewhat usable, I had switched to manually editing scriptable objects.

Thank you

1 Like