| Parameter | Description |
|---|---|
| version | The string representation of the Android SDK version to parse, for example 36 or 36.1. |
| parsed | When this method returns, contains the parsed AndroidSdkVersionFull if parsing succeeded, or null otherwise. |
void
true if version was successfully parsed; otherwise, false.
Tries to parse an Android SDK version from a string, for example 36 or 36.1.
This method doesn't support previews and extension SDKs, such as 37.2-beta1, 36-ext18 and returns false.
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; } }