Hello,
I’m having some trouble while using this package. I think that depending on initialization order I’m getting some exceptions:
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Localization.Settings.LocalizedDatabase`2[TTable,TEntry].GetTableLoadTable (UnityEngine.Localization.Tables.TableReference tableReference, UnityEngine.Localization.Locale locale) (at Library/PackageCache/com.unity.localization@0.6.1-preview/Runtime/Settings/Database/LocalizedDatabase.cs:191)
UnityEngine.Localization.Settings.LocalizedDatabase`2[TTable,TEntry].GetTableLoadTable (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] sharedTableDataOperation, UnityEngine.Localization.Locale locale) (at Library/PackageCache/com.unity.localization@0.6.1-preview/Runtime/Settings/Database/LocalizedDatabase.cs:212)
UnityEngine.Localization.Settings.LocalizedDatabase`2+<>c__DisplayClass23_0[TTable,TEntry].<GetTableLoadTable>b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] op) (at Library/PackageCache/com.unity.localization@0.6.1-preview/Runtime/Settings/Database/LocalizedDatabase.cs:188)
UnityEngine.ResourceManagement.ChainOperation`2[TObject,TObjectDependency].Execute () (at Library/PackageCache/com.unity.addressables@1.6.2/Runtime/ResourceManager/AsyncOperations/ChainOperation.cs:34)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeExecute () (at Library/PackageCache/com.unity.addressables@1.6.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:409)
UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].<.ctor>b__33_0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle o) (at Library/PackageCache/com.unity.addressables@1.6.2/Runtime/ResourceManager/AsyncOperations/AsyncOperationBase.cs:110)
DelegateList`1[T].Invoke (T res) (at Library/PackageCache/com.unity.addressables@1.6.2/Runtime/ResourceManager/Util/DelegateList.cs:69)
UnityEngine.Debug:LogException(Exception)
DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.6.2/Runtime/ResourceManager/Util/DelegateList.cs:73)
UnityEngine.ResourceManagement.Util.DelayedActionManager:LateUpdate() (at Library/PackageCache/com.unity.addressables@1.6.2/Runtime/ResourceManager/Util/DelayedActionManager.cs:169)
The offending like is:
if (TableOperations.TryGetValue((locale.Identifier, tableReference), out var asyncOp))
at LocalizedDatabase.cs, and the null reference is that locale object.
This happens in my current scene when I just add some UI button (using TMP_Text) but it doesn’t use localized strings itself, or (and this is the most strange one) even when I’m just editing a prefab and run the game, without changing anything else.
May I know if I’m doing anything wrong, or if I need to change initialization order of some script for this to work properly? I’ve tried rebuilding addressables and things like that, but this obviously doesn’t make much sense, as it works fine until I do on of those two things.
Thanks in advance.
