Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

SystemInfo.operatingSystem

public static string operatingSystem;

Description

Operating system name with version (Read Only).

Returns detailed information about the operating system of the device, including the version. For a simple platform detection, properties like Application.platform or deviceType might be more appropriate.

using UnityEngine;

public class ExampleClass : MonoBehaviour { void Start() { // Prints "Windows 7 (6.1.7601) 64bit" on 64 bit Windows 7 // Prints "Mac OS X 10.10.4" on OS X Yosemite // Prints "iPhone OS 8.4" on iOS 8.4 // Prints "Android OS API-22" on Android 5.1 Debug.Log (SystemInfo.operatingSystem); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961