Class LocalizedDatabase<TTable, TEntry>
Namespace: UnityEngine.Localization.Settings
Syntax
[Serializable]
public abstract class LocalizedDatabase<TTable, TEntry> : IPreloadRequired where TTable : LocalizedTableT<TEntry> where TEntry : TableEntry
Type Parameters
Name | Description |
---|---|
TTable | |
TEntry |
Properties
DefaultTable
The default table to use when no table collection name is provided.
Declaration
public TableReference DefaultTable { get; set; }
Property Value
Type | Description |
---|---|
TableReference |
PreloadOperation
Preload operation. Loads all tables and their contents(when applicable) marked with the preload label for the selected locale.
Declaration
public AsyncOperationHandle PreloadOperation { get; }
Property Value
Type | Description |
---|---|
AsyncOperationHandle |
Implements
ResourceManager
The ResourceManager to use when generating loading operations. By default uses UnityEngine.Localization.Settings.LocalizationSettings.ResourceManager
Declaration
protected virtual ResourceManager ResourceManager { get; }
Property Value
Type | Description |
---|---|
ResourceManager |
Methods
GetTableAsync(TableReference)
Returns the named table. This function is asynchronous and may not have an immediate result available. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.
Declaration
public AsyncOperationHandle<TTable> GetTableAsync(TableReference tableReference)
Parameters
Type | Name | Description |
---|---|---|
TableReference | tableReference | The table identifier. Can be either the name of the table or the table collection name Guid. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<TTable> |
GetTableAsync(TableReference, Locale)
Returns the named table. This function is asynchronous and may not have an immediate result available. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.
Declaration
public virtual AsyncOperationHandle<TTable> GetTableAsync(TableReference tableReference, Locale locale)
Parameters
Type | Name | Description |
---|---|---|
TableReference | tableReference | The table identifier. Can be either the name of the table or the table collection name Guid. |
Locale | locale | The Locale to load the table from if you do not wish to use SelectedLocale. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<TTable> |
GetTableEntryAsync(TableReference, TableEntryReference)
Returns the entry from the requested table. A table entry will contain the localized item and metadata. This function is asynchronous and may not have an immediate result available. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.
Declaration
public virtual AsyncOperationHandle<LocalizedDatabase<TTable, TEntry>.TableEntryResult> GetTableEntryAsync(TableReference tableReference, TableEntryReference tableEntryReference)
Parameters
Type | Name | Description |
---|---|---|
TableReference | tableReference | The table identifier. Can be either the name of the table or the table collection name Guid. |
TableEntryReference | tableEntryReference | A reference to the entry in the table. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<LocalizedDatabase.TableEntryResult<>> |
GetTableEntryAsync(TableReference, TableEntryReference, Locale)
Returns the entry from the requested table. A table entry will contain the localized item and metadata. This function is asynchronous and may not have an immediate result available. Check IsDone to see if the data is available, if it is false then use the Completed event or yield on the operation.
Declaration
public AsyncOperationHandle<LocalizedDatabase<TTable, TEntry>.TableEntryResult> GetTableEntryAsync(TableReference tableReference, TableEntryReference tableEntryReference, Locale locale)
Parameters
Type | Name | Description |
---|---|---|
TableReference | tableReference | The table identifier. Can be either the name of the table or the table collection name Guid. |
TableEntryReference | tableEntryReference | A reference to the entry in the table. |
Locale | locale | The Locale to load the table from if you do not wish to use SelectedLocale. |
Returns
Type | Description |
---|---|
AsyncOperationHandle<LocalizedDatabase.TableEntryResult<>> |
OnLocaleChanged(Locale)
Called before the LocaleChanged event is sent out in order to give the database a chance to prepare.
Declaration
public virtual void OnLocaleChanged(Locale locale)
Parameters
Type | Name | Description |
---|---|---|
Locale | locale |