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.
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
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 |