Unity 6.3
0 онлайн 9 гостей 3 в системе
Вход

Device.systemVersion

Declaration

public static string systemVersion;

Описание

Версия операционной системы, которая в настоящее время запущена на устройстве.

Версия iOS в виде строки: major.minor или major.minor.patch (например, "14.0", "8.0.2"). Используйте System.Version или Version.TryParse для сравнения.

using UnityEngine;
using UnityEngine.iOS;

public class SystemVersionExample : MonoBehaviour { bool allowFeature = true;

void Start() { // Get the iOS version of the device this is running on string systemVersion = Device.systemVersion;

// Separate the version string to major and minor version numbers string[] separatedVersion = systemVersion.Split('.');

// Parse the major version number to an integer that can be used for comparison int majorVersion = int.Parse(separatedVersion[0]);

// Check if major version number of the device this is running on is below iOS 12 if (majorVersion < 12) { // Log a message and disable the version-specific features. Debug.Log("Sorry, this amazing feature requires iOS 12 and above to work. Please update your iOS version."); allowFeature = false; } } }