用户操作系统运行的语言。
您可以使用它根据用户的系统语言自动选择内容的本地化。使用 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); } }