Skip to content

Instantly share code, notes, and snippets.

@karljj1
Created October 1, 2021 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karljj1/f2707f9eee7f4cff37fe90493d9098c4 to your computer and use it in GitHub Desktop.
Save karljj1/f2707f9eee7f4cff37fe90493d9098c4 to your computer and use it in GitHub Desktop.
public class PatchTableContents : MonoBehaviour
{
public IEnumerator Start()
{
// Load the table.
var table = LocalizationSettings.StringDatabase.GetTableAsync("My Table");
yield return table;
// Prevent the table from being unloaded and the changes lost.
Addressables.ResourceManager.Acquire(table);
// Apply our changes
var stringTable = table.Result;
var entry = stringTable.GetEntry("Some Entry");
entry.Value = "Hello World";
// Create a new entry
var newEntry = stringTable.AddEntry("New Entry", "Localized Value");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment