Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryParse(string, out AndroidSdkVersionFull)

Tries to parse an Android SDK version from a string, for example 36 or 36.1.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

TryParse(string, AndroidSdkVersionFull)

public static bool TryParse(string version, out AndroidSdkVersionFull parsed)

Parameters

version

The string representation of the Android SDK version to parse, for example
36
or
36.1
.

When this method returns, contains the parsed AndroidSdkVersionFull if parsing succeeded, or null otherwise.

Returns

Type

Description

booltrue if
version
was successfully parsed; otherwise, false.

Remarks

This method doesn't support previews and extension SDKs, such as
37.2-beta1
,
36-ext18
and returns false.

Examples

using UnityEngine;using UnityEditor;public class AndroidSdkVersionFullTryParseSample : MonoBehaviour{ [MenuItem("Build/AndroidSdkVersionFull TryParse Sample")] public static void ParseAndroidSdkVersionFull() { if (AndroidSdkVersionFull.TryParse("36.1", out AndroidSdkVersionFull version)) PlayerSettings.Android.compileSdkVersion = version; }}