Method PreloadTables
PreloadTables(TableReference, Locale)
Preloads the selected table. If the table is an Asset
Declaration
public AsyncOperationHandle PreloadTables(TableReference tableReference, Locale locale = null)
Parameters
Type | Name | Description |
---|---|---|
Table |
tableReference | A reference to the table. A table reference can be either the name of the table or the table collection name Guid. |
Locale | locale | The Locale to use instead of the default Selected |
Returns
Type | Description |
---|---|
Async |
PreloadTables(IList<TableReference>, Locale)
Preloads the matching tables for the selected Locale. If the tables are Asset
Declaration
public AsyncOperationHandle PreloadTables(IList<TableReference> tableReferences, Locale locale = null)
Parameters
Type | Name | Description |
---|---|---|
IList<Table |
tableReferences | An IList of tableReferences to check for the string. |
Locale | locale | The Locale to use instead of the default Selected |
Returns
Type | Description |
---|---|
Async |
Examples
This shows how to manually preload tables instead of marking them as Preload in the editor.
public class PreloadingSample : MonoBehaviour
{
IEnumerator Start()
{
// Tables that are not marked as Preload can be manually preloaded.
var preloadOperation = LocalizationSettings.StringDatabase.PreloadTables(new TableReference[] { "UI Text", "Game Text" });
yield return preloadOperation;
// Get some text from the table, this will be immediately available now the table has been preloaded
var uiText = LocalizationSettings.StringDatabase.GetTableEntryAsync("UI Text", "Start_Game").Result;
Debug.Log(uiText);
}
}