docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)