Created
October 1, 2021 10:34
-
-
Save karljj1/f2707f9eee7f4cff37fe90493d9098c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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