Hi, is there a way to get the table window’s current table by script ?
I want to get a table reference or name to add entry to it in editor mode, so I won’t need to change the
table reference in script or change the default table, such as
var tabRef = LocalizationSettings.StringDatabase.DefaultTable;
var table = LocalizationEditorSettings.GetStringTableCollection(tabRef);
var stringTable = table.GetTable("en") as StringTable;
var newKey = stringTable.SharedData.AddKey();
var entry = stringTable.AddEntry(newKey.Id, conversationText.Value);
LocalizationEditorSettings.EditorEvents.RaiseCollectionModified(null, table);
EditorUtility.SetDirty(stringTable);
EditorUtility.SetDirty(stringTable.SharedData);
localizedConversation.SetReference(tabRef, entry.KeyId);
LocalizationTablesWindow has an api for setting the table to be edited but it doesn’t have one to see the one currently edited.
What exactly is it you want to do? Force the window to update when you add an entry?
I clicked the ‘add entry’, then the text can be added to table.
I just think If I can get something like ‘var table = LocalizationTablesWindow.currentTable’, it will be more
convenient.
Also, I found some minor problems in 2020.3.35 (sorry for not testing in newer versions)
In the right, you can see another Entry Name covering the string Reference.
And when I change the Entry Name in table window, the string reference can only refresh for one time,then I must reload to see the change. The Entry Name below can follow the table.
Sorry for my poor English.