Hi. I have an interesting issue. I have an asset table with audio clips. I turned on Preload for the table, chose English fallback for Spanish and checked fallback for asset tables. There are no audio sources for Spanish, only for English.
Then I called first code example:
await LocalizationSettings.InitializationOperation.ToUniTask();
await LocalizationSettings.AssetDatabase.GetLocalizedAssetAsync<AudioClip>("tableName", "key");
it throws NullReferenceException: Object reference not set to an instance of an object.
next code example:
LocalizationSettings.Instance.ResetState();
await LocalizationSettings.AssetDatabase.GetLocalizedAssetAsync<AudioClip>("tableName", "key");
it works !
Example 1 works if:
- I change my language in app to Spanish.
- Only after a language has changed, then call first code example.
Seems like after language change, localization system works properly.
Am I doing something wrong, or there is some bug ? Thanks
Upd. Example 1 also works in a new empty project without language change…