Search Unity

Localizes Asset Reference serialization is broken

Discussion in 'Localization Tools' started by Skibitsky, Nov 3, 2020.

  1. Skibitsky

    Skibitsky

    Joined:
    Mar 22, 2016
    Posts:
    24
    Hello,

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

    How it should be:
    LocalizeComponentTexture2D.png

    How it actually is:
    Localizes Asset Reference serialization is broken.png

    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?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,299
    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?
     
    Last edited: Nov 3, 2020
  3. Skibitsky

    Skibitsky

    Joined:
    Mar 22, 2016
    Posts:
    24
    There is no compilation issues
     

    Attached Files:

  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,299
    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.
     
  5. Skibitsky

    Skibitsky

    Joined:
    Mar 22, 2016
    Posts:
    24
    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.
     
    Last edited: Mar 30, 2021
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,299
    Ah yes this confused me :rolleyes:

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

    Mike-Salyh

    Joined:
    Jun 28, 2013
    Posts:
    1
    I'm also experiencing this issue. It seems to be related to the Odin Inspector (https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041) 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?)
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,299
    If you know the table name and key then you can do something like LocalizationSettings.AssetDatabase.LoadAssetAsync
     
  9. Skibitsky

    Skibitsky

    Joined:
    Mar 22, 2016
    Posts:
    24
    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.
     

    Attached Files: