No localized text table after scene change

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

No localized text table after scene change

Post by VoodooDetective »

My main menu has localized UI text on it. Whenever I scene change back to the main menu, I get a bunch of warnings saying:

Code: Select all

No localized text table is assigned to Game Menu Text or a UI Localized Manager component.
UnityEngine.Debug:LogWarning(Object, Object)
PixelCrushers.LocalizeUI:UpdateText() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/LocalizeUI.cs:95)
PixelCrushers.LocalizeUI:Start() (at Assets/Plugins/Pixel Crushers/Common/Scripts/UI/LocalizeUI.cs:75)
The DialogueManager has a Text Table set and it does seem to work if I START OUT in the game menu scene, but for whatever reason if I scene change into the main menu, the Localize UI component seems to be unable to access the text table on Start().

Am I missing a step here?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: No localized text table after scene change

Post by Tony Li »

Hi,

On any Dialogue Manager GameObjects in any scenes, have you changed the values of Other Settings > Dont Destroy On Load? I wonder if maybe the "wrong" Dialogue Manager is surviving into the scene change, and this Dialogue Manager doesn't have a text table assigned to it.
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: No localized text table after scene change

Post by VoodooDetective »

So the game menu scene has a Dialogue Manager with the Don't Destroy on Load ticked. The other scene did too, but I removed it entirely to see if that helped and got the same result. Tried turning on debugging, but that didn't seem to help.

It seems like it's a race condition because when I navigate back to the menu scene, only the two first visible text options throw that warning. Once I open other localized menus further along in this "timeline," those menu items are able to find the text table.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: No localized text table after scene change

Post by Tony Li »

If that's the case, you should be able to resolve the race condition by adding a UILocalizationManager component to the Dialogue Manager and assigning the text table to it. (The same text table that's assigned to the DialogueSystemController component.)
VoodooDetective
Posts: 222
Joined: Wed Jan 22, 2020 10:48 pm

Re: No localized text table after scene change

Post by VoodooDetective »

That did it! Thanks so much!!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: No localized text table after scene change

Post by Tony Li »

Glad to help!
Post Reply