Localizes Asset Reference serialization is broken

Hello,

The Localizes Asset Reference serialization is broken is broken in our project. The string reference is fine though.

How it should be:
6485535--728853--LocalizeComponentTexture2D.png

How it actually is:

Rebuilding Library and reimporting the package doesn’t fix it. To submit bug report I tried to reproduce the issue in the empty project, but with no luck - it works fine there.

Any ideas on what can affect the serialization?

That doesn’t look like a serialization issue, seems like the custom editor is not being used. Do you have the inspector in debug mode? Is there any compilation issues in the project? Can you share the log file?

There is no compilation issues


6503834–732473–Editor.txt (537 KB)

Are you sure the inspector is not in debug mode? Some of those fields are only visible when it is. Right click the inspector tab and make sure Normal is ticked and not Debug. Debug mode does not use custom editors or property drawers.

I am pretty sure. In the screenshot from my original you can clearly see the working inspector of Localize String Event below Localize Texture Event. I’ve attached the screenshot of Debug inspector to my last post. They look differently.

I’ve just cloned the project on Windows and the issue is present there as well. Before I used unreleased macOS Big Sur, but the problem seems to be elsewhere.

I also removed all our scripts and most of third-party assets (including Editor tools such as Odin Inspector), however the custom Editor is still not being used.

Ah yes this confused me :roll_eyes:

I have tried to recreate it locally but had no luck. Could you file a bug report?

I’m also experiencing this issue. It seems to be related to the Odin Inspector (Odin Inspector and Serializer | Utilities Tools | Unity Asset Store) and not directly a problem of the Serialization package.

I started a new project and imported localization (v0.10.0). No issues.
Then, I imported Odin Inspector into the project, and the issue occurred. I believe Odin is making certain field visible when they should not be, thus suppressing the Localization custom editor. I don’t know enough about the interaction between the two to diagnose any deeper than that.

Since Odin is deeply integrated into our game, I believe I’ll need to find another workaround to using the Localize Sprite Event script. (Perhaps accessing the loc tables directly through scripting / writing my own component?)

If you know the table name and key then you can do something like LocalizationSettings.AssetDatabase.LoadAssetAsync

The workaround is to disable Odin for broken components in Odin Preferences (Tools > Odin Inspector > Preferences).

If you have custom components with LocalizedAsset<T> fields, you will need to disable Odin for the whole component.

10 Likes