docs.unity3d.com
    Show / Hide Table of Contents

    Class LocalizedDatabase<TTable, TEntry>

    Inheritance
    Object
    LocalizedDatabase<TTable, TEntry>
    LocalizedAssetDatabase
    LocalizedStringDatabase
    Namespace: UnityEngine.Localization.Settings
    Syntax
    [Serializable]
    public abstract class LocalizedDatabase<TTable, TEntry> : IPreloadRequired where TTable : DetailedLocalizationTable<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 virtual 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
    IPreloadRequired.PreloadOperation

    UseFallback

    Should the fallback Locale be used when a translation could not be found?.

    Declaration
    public bool UseFallback { get; set; }
    Property Value
    Type Description
    Boolean

    Methods

    GetDefaultTableAsync()

    Returns the Default 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> GetDefaultTableAsync()
    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 = null)
    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, use null to default to cref="LocalizationSettings.SelectedLocale"/>.

    Returns
    Type Description
    AsyncOperationHandle<TTable>

    GetTableEntryAsync(TableReference, TableEntryReference, Locale, FallbackBehavior)

    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. 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 to prevent the operation being reused and to finally return the operation back to the pool.

    Declaration
    public virtual AsyncOperationHandle<LocalizedDatabase<TTable, TEntry>.TableEntryResult> GetTableEntryAsync(TableReference tableReference, TableEntryReference tableEntryReference, Locale locale = null, FallbackBehavior fallbackBehavior = FallbackBehavior.UseProjectSettings)
    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. Null will use SelectedLocale.

    FallbackBehavior fallbackBehavior

    A Enum which determines if a Fallback should be used when no value could be found for the Locale.

    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

    PreLoadTables(IList<TableReference>, Locale)

    Attempts to retrieve all the Tables at once This function is asynchronous and may not have an immediate result. 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 PreLoadTables(IList<TableReference> tableReferences, Locale locale = null)
    Parameters
    Type Name Description
    IList<TableReference> tableReferences

    An IList of tableReferences to check for the string.

    Locale locale

    The Locale to use instead of the default SelectedLocale

    Returns
    Type Description
    AsyncOperationHandle

    PreLoadTables(TableReference, Locale)

    Declaration
    public AsyncOperationHandle PreLoadTables(TableReference tableReference, Locale locale = null)
    Parameters
    Type Name Description
    TableReference tableReference
    Locale locale
    Returns
    Type Description
    AsyncOperationHandle

    Extension Methods

    TupleExtensions.IsValueTuple(Object)
    TupleExtensions.GetValueTupleItemObjects(Object)
    TupleExtensions.GetValueTupleItemObjectsFlattened(Object)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023