docs.unity3d.com
    目次を表示する/隠す

    Class LocalesProvider

    Responsible for providing the list of locales that are currently available to this application.

    Inheritance
    Object
    LocalesProvider
    Namespace: UnityEngine.Localization.Settings
    Syntax
    [Serializable]
    public class LocalesProvider : ILocalesProvider, IPreloadRequired, IReset

    Properties

    Locales

    The list of all supported locales.

    Declaration
    public List<Locale> Locales { get; }
    Property Value
    Type Description
    List<Locale>
    Implements
    ILocalesProvider.Locales

    PreloadOperation

    The Locales loading operation. When set to isDone then all locales have been loaded. Can be Null if the operation has not started yet.

    Declaration
    public AsyncOperationHandle PreloadOperation { get; }
    Property Value
    Type Description
    AsyncOperationHandle
    Implements
    IPreloadRequired.PreloadOperation

    Methods

    AddLocale(Locale)

    Add a Locale to allow support for a specific language.

    Declaration
    public void AddLocale(Locale locale)
    Parameters
    Type Name Description
    Locale locale
    Implements
    ILocalesProvider.AddLocale(Locale)

    FindFallbackLocale(LocaleIdentifier)

    Attempt to retrieve a fallback Locale using the identifier.

    Declaration
    public Locale FindFallbackLocale(LocaleIdentifier localeIdentifier)
    Parameters
    Type Name Description
    LocaleIdentifier localeIdentifier

    LocaleIdentifier to find.

    Returns
    Type Description
    Locale

    If no Locale can be found then null is returned.

    GetLocale(String)

    Attempt to retrieve a Locale or fallback Locale using a Code.

    Declaration
    public Locale GetLocale(string code)
    Parameters
    Type Name Description
    String code

    If no Locale can be found then null is returned.

    Returns
    Type Description
    Locale

    GetLocale(LocaleIdentifier)

    Attempt to retrieve a Locale or fallback Locale using the identifier.

    Declaration
    public Locale GetLocale(LocaleIdentifier id)
    Parameters
    Type Name Description
    LocaleIdentifier id

    LocaleIdentifier to find.

    Returns
    Type Description
    Locale

    If no Locale can be found then null is returned.

    Implements
    ILocalesProvider.GetLocale(LocaleIdentifier)

    GetLocale(SystemLanguage)

    Attempt to retrieve a Locale or fallback Locale using a SystemLanguage.

    Declaration
    public Locale GetLocale(SystemLanguage systemLanguage)
    Parameters
    Type Name Description
    SystemLanguage systemLanguage
    Returns
    Type Description
    Locale

    If no Locale can be found then null is returned.

    RemoveLocale(Locale)

    Removes support for a specific Locale.

    Declaration
    public bool RemoveLocale(Locale locale)
    Parameters
    Type Name Description
    Locale locale

    The locale that should be removed if possible.

    Returns
    Type Description
    Boolean

    true if the locale was removed or false if the locale did not exist.

    Implements
    ILocalesProvider.RemoveLocale(Locale)

    ResetState()

    Resets the state of the provider by removing all the Locales and clearing the preload operation.

    Declaration
    public void ResetState()
    Implements
    IReset.ResetState()
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)