Class LocalizedDatabase<TTable, TEntry>
Provides common functionality for both string and asset table fetching.
Namespace: UnityEngine.Localization.Settings
Assembly: Unity.Localization.dll
Syntax
[Serializable]
public abstract class LocalizedDatabase<TTable, TEntry> : IPreloadRequired, IReset where TTable : DetailedLocalizationTable<TEntry> where TEntry : TableEntry
Type Parameters
Name | Description |
---|---|
TTable | |
TEntry |
Constructors
Name | Description |
---|---|
LocalizedDatabase() | Creates a new instance of the database. |
Properties
Name | Description |
---|---|
AsynchronousBehaviour | Options for how to handle asyncronous operations. |
DefaultTable | The default table to use when no table collection name is provided. |
PreloadOperation | Preload operation. Loads all tables and their contents(when applicable) marked with the preload label for the selected locale. |
TablePostprocessor | Gets a notification when a table completes loading. This can be used to apply changes to a table at runtime, such as updating or creating new entries. |
TableProvider | Called when attempting to load a table, can be used to override the default table loading through Addressables in order to provide a custom table. |
UseFallback | Should the fallback Locale be used when a translation could not be found?. |
Methods
Name | Description |
---|---|
GetAllTables(Locale) | Returns all the tables available. This method is asynchronous and may not have an immediate result. Check IsDone to see if the tables are available. if it is false then you can use the Completed event to get a callback when it is finished, yield on the operation or call WaitForCompletion to force the operation to complete.``` |
GetDefaultTableAsync() | Returns the Default table. This method is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then you can use the Completed event to get a callback when it is finished, yield on the operation or call WaitForCompletion to force the operation to complete. |
GetTable(TableReference, Locale) | Returns the named table. Uses WaitForCompletion to force the loading to complete synchronously. Please note that WaitForCompletion is not supported on WebGL. |
GetTableAsync(TableReference, Locale) | Returns the named table. This method is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then you can use the Completed event to get a callback when it is finished, yield on the operation or call WaitForCompletion to force the operation to complete. |
GetTableEntry(TableReference, TableEntryReference, Locale, FallbackBehavior) | Returns the entry from the requested table. A table entry will contain the localized item and metadata. Uses WaitForCompletion to force the loading to complete synchronously. Please note that WaitForCompletion is not supported on WebGL. |
GetTableEntryAsync(TableReference, TableEntryReference, Locale, FallbackBehavior) | Returns the entry from the requested table. A table entry will contain the localized item and metadata. This method is asynchronous and may not have an immediate result. Check IsDone to see if the data is available, if it is false then you can use the Completed event to get a callback when it is finished, yield on the operation or call WaitForCompletion to force the operation to complete. Once the Completed event has been called, during the next update, the internal operation will be returned to a pool so that it can be reused. If you do plan to keep hold of the handle after completion then you should call Acquire to prevent the operation being reused and UnityEngine.AddressableAssets.Addressables.Release(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle) to finally return the operation back to the pool. |
IsTableLoaded(TableReference, Locale) | Checks if the table is currently loaded or not. |
OnLocaleChanged(Locale) | Called before the LocaleChanged event is sent out in order to give the database a chance to prepare. |
PreloadTables(IList<TableReference>, Locale) | Preloads the matching tables for the selected Locale. If the tables are AssetTable then their assets will also be loaded. Check IsDone to see if the data is available, if it is false then you can use the Completed event to get a callback when it is finished, yield on the operation or call WaitForCompletion to force the operation to complete. |
PreloadTables(TableReference, Locale) | Preloads the selected table. If the table is an AssetTable its assets will also be loaded. Check IsDone to see if the data is available, if it is false then you can use the Completed event to get a callback when it is finished, yield on the operation or call WaitForCompletion to force the operation to complete. |
ReleaseAllTables(Locale) | Releases all tables that are currently loaded in the database. This will also release any references to the SharedTableData providing there are no other references to it, such as different Locale versions of the table that have been loaded. |
ReleaseTable(TableReference, Locale) | Releases all references to the table that matches the |
ResetState() | Resets the state of the provider by removing all the cached tables and clearing the preload operation. |