Interface IStartupLocaleSelector
Determines what locale should be used for the SelectedLocale when the application starts or does not currently have an active SelectedLocale.
Namespace: UnityEngine.Localization.Settings
Assembly: Unity.Localization.dll
Syntax
public interface IStartupLocaleSelector
Examples
This example shows how to implement a custom selector. Once implemented, you can add the custom selector in the Startup Selectors menu.
using System;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;
[DisplayName("My Startup Selector")]
[Serializable]
public class StartupSelectorExample : IStartupLocaleSelector
{
// Allow the user to select a specific language to use.
public SystemLanguage language;
public Locale GetStartupLocale(ILocalesProvider availableLocales)
{
// Return the Locale that matches the language field or null if one does not exist.
return availableLocales.GetLocale(language);
}
}
Methods
Name | Description |
---|---|
GetStartupLocale(ILocalesProvider) | Used to determine which Locale should be used. |