Page 1 of 1

Prefabs with LocalizeUI components being saved to disk with current language

Posted: Wed Feb 28, 2024 1:56 pm
by vcesauron
I recently updated the Dialogue System plugin from version 2.2.33 to 2.2.43, and apparently it now localizes assets when saving the project.

The issue is that if I change the game's language through my in-game options menu, next time I hit save (or enter Play Mode, as DS is also saving assets at that moment now), it's going to save many prefabs that have the LocalizeUI component with the new language. This pollutes the version control, while also being inconvenient to have prefabs changing indirectly just because I'm playtesting something.

Some details:
  • It's only a few prefabs, not all of them. I couldn't figure out how the ones affected differ from the others. They're all essentially prefabs with a TextMeshProUGUI component and a LocalizeUI component.
  • My in-game menu changes language with

    Code: Select all

    DialogueManager.instance.SetLanguage(langCode);
  • I didn't have this problem in the previous version 2.2.33.
  • Also upgraded Unity from 2021.3.0f1 to 2022.3.20f1
Can I prevent LocalizeUI from changing my prefabs?

Re: Prefabs with LocalizeUI components being saved to disk with current language

Posted: Wed Feb 28, 2024 4:06 pm
by Tony Li
Hi,

Here's a fix:

PixelCrushersGameObjectUtilityPatch_2024-02-28.unitypackage

It looks like in Unity 2022 the hide flags might be different on prefabs, which is causing the issue.

In Unity 2023+, the Dialogue System uses the newer and faster FindObjectsByType<T>() method which doesn't have this issue. This method was introduced in Unity 2022.3.0, so the fix uses it for your Unity version. (For older Unity versions, I'll implement a different fix in DS version 2.2.44.)

Re: Prefabs with LocalizeUI components being saved to disk with current language

Posted: Wed Feb 28, 2024 4:31 pm
by vcesauron
Yeah, that worked. That was quick, haha :D Thanks Tony!

Re: Prefabs with LocalizeUI components being saved to disk with current language

Posted: Wed Feb 28, 2024 4:33 pm
by Tony Li
Glad to help!