Version: 2021.1

Application.systemLanguage

切换到手册
public static SystemLanguage systemLanguage ;

描述

用户操作系统运行时所使用的语言。

您可以使用此属性来根据用户的系统语言自动为内容选择本地化。使用 Application.systemLanguage 查找此设置的值。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { //This checks if your computer's operating system is in the French language if (Application.systemLanguage == SystemLanguage.French) { //Outputs into console that the system is French Debug.Log("This system is in French. "); } //Otherwise, if the system is English, output the message in the console else if (Application.systemLanguage == SystemLanguage.English) { Debug.Log("This system is in English. "); } } }
using UnityEngine;

public class Example : MonoBehaviour { void Start() { //This outputs what language your system is in Debug.Log("This system is in " + Application.systemLanguage); } }