Custom locale selectors are Empty on project reload

Pretty much the thread title - I have two Locale Selectors I’d like to have run before the default ones, the RegionLocaleSelector and the StageLocaleSelector. I can add them to the list as follows:

When I add them both to the list and move them to the top, I get the following errors in the console:

However, it appears to work, because when I run our project in the editor, I am able to see print statements from those locale selectors, and they select the locale properly:

As well, once I close Unity, the LocalizationSettings file appears to have saved correctly, since my new LocaleSelectors appear in the Git diff of the file:

6368022--708762--upload_2020-9-30_15-38-36.png

However, once I load the project up again, I see this in the Locale Selectors, and I get NullReferenceExceptions trying to run the project through the editor.

Am I missing something here, or is this a bug?

What version of Unity are you using? This was a bug with SerialiseReference but it should be fixed. Can you try updating to the latest patch/version?

The bug was caused by having a Serialised class that contained no serializable fields. So if you want to just work around it then add a placeholder field that can be serialized.

E.g

[SerializeField, HideInInspector]
Int myPlaceholderValue.

We are on 2019.3.3f1 with localization at 8.1 and addressables at 1.15.1. This workaround fixed for us - thank you!

1 Like