Hello,
I’ve created an asset table called ‘Posters’ with some entries. Each entry is referencing a sprite. In my scriptable object I have a field for referencing a certain entry, like so:
[SerializeField] private LocalizedSprite _poster;
I have an issue when trying to set the references in the inspector. As long as I haven’t added an object into the locale column, I can access the entries in the inspector fine.
Everything looks good
However, if I add a sprite reference to one or both locales, the entry for which I’ve added the sprite reference is no longer available in the inspector.
Notice, the MODULE_POSTER_MAGNETISM is no longer available in the inspector
There is however a workaround to get this to work via the inspector:
- Choose the scriptable object where you want to add the LocalizedSprite reference.
- Collapse the reference.
- Choose the Table Collection (or create a new one).
- Add Table Entry.
- Fill out Entry Name.
- Add the sprite references.
- Ctrl+S to save and the Localization Tables tab will update as well.
- Notice that you can now use this entry everywhere.
Workaround
I’ve noticed 2 things that might hint at what is wrong.
- In my script I have the variable type LocalizedSprite, which expects a LocalizedAsset with Sprite as the generic type.
- In the second image, notice that once I’ve added one sprite to the English locale column, the second locale column expects a Texture 2D and not a sprite. And this is probably why the entry is not seen in the inspector. It expects a Sprite and not a Texture 2D.
- In the third image (step 6 of the workaround), note that once I’ve added the English locale sprite, the expected sprite in the inspector correctly shows Sprite.
- The referenced .jpg Texture Type is set to Sprite (2D and UI), so this should be correct.
The issue seems to be that when adding images to locales via the Localization Tables window, it marks them as Texture 2D instead. Doing this via the inspector however, marks them correctly.
Unity: 2021.1.25f1
Addressables: 1.19.9
Localization: 1.0.4
Any ideas what might be the issue or how to work around this? Am I doing something incorrectly?
Thanks!



