docs.unity3d.com
    Show / Hide Table of Contents

    Class PlayerPrefLocaleSelector

    Uses the Player Prefs to keep track of the last used locale. Whenever the locale is changed, the new Locale is recorded in the Player prefs.

    Inheritance
    Object
    PlayerPrefLocaleSelector
    Namespace: UnityEngine.Localization.Settings
    Syntax
    public class PlayerPrefLocaleSelector : object, IStartupLocaleSelector, IInitialize

    Properties

    PlayerPreferenceKey

    The Player Pref key to use.

    Declaration
    public string PlayerPreferenceKey { get; set; }
    Property Value
    Type Description
    String

    Methods

    GetStartupLocale(ILocalesProvider)

    Returns the last locale set or null if no value has been recorded yet.

    Declaration
    public Locale GetStartupLocale(ILocalesProvider availableLocales)
    Parameters
    Type Name Description
    ILocalesProvider availableLocales
    Returns
    Type Description
    Locale
    Implements
    IStartupLocaleSelector.GetStartupLocale(ILocalesProvider)

    PostInitialization(LocalizationSettings)

    Registers a callback to SelectedLocaleChanged in order to save changes made to the Locale.

    Declaration
    public void PostInitialization(LocalizationSettings settings)
    Parameters
    Type Name Description
    LocalizationSettings settings
    Implements
    IInitialize.PostInitialization(LocalizationSettings)
    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