However if I replace the KeyId by the key (string), the binding seems not to works.
My LocalizedString is binded to the table but not to the entry, thus it can’t resolve the bind (the root string in the inspector stays as “None (String)”.
Something is odd here…
I am adding the entry in the table (from a string table name and string entry name), then send back the table guid and entry uint key to set up my LocalizedString. Then I am trying to save the text value using the LocalizedString.
The LocalizedString seems to be set up correctly but table.ContainsKey(key_id) returns false.
I see 2 possibilities:
First the creation is an async operation and thus the entry don’t exists yet when querying (doing it all in the same frame).
Second I am modifying the table on disk and querying the one in memory, or the opposite
?
I noticed that creating by script entries in a collection sharedData table won’t create them in the associated LocalizedTable.
That leads StringTable.GetEntry(uint key) to returns null while the entry seems to be created in the editor interface, which is very misleading.
I think creating an entry in SharedData should be reflected in all LocalizedTable behind the scene, and AddEntry() on a LocalizedTable should be redirected to creating the entry in the SharedData to ensure consistency
How to fix this " public LocalizedString aaa;" not work in editor ? It’s not same like document.
But I create in a new project The " public LocalizedString aaa;" is work.
Wanted to add to this to help people searching for it.
LocalizedString variables (in my case, with scriptable objects) can have an error where it shows a null IVariable and empty key in the inspector. I was working through Unity’s Open Project where there are selectable string tables string tables. The problem was indeed Odin Serializer; updating to the most recent version fixed the issue.