Prefabs with LocalizeUI components being saved to disk with current language

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
vcesauron
Posts: 17
Joined: Tue Oct 06, 2020 11:22 am

Prefabs with LocalizeUI components being saved to disk with current language

Post 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?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.)
User avatar
vcesauron
Posts: 17
Joined: Tue Oct 06, 2020 11:22 am

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

Post by vcesauron »

Yeah, that worked. That was quick, haha :D Thanks Tony!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Glad to help!
Post Reply