@@ -413,10 +413,17 @@ public OculusGoRecommendedSettings()
413413#endif
414414 }
415415 }
416+
416417 public static partial class VIUSettingsEditor
417418 {
418419 public const string URL_OCULUS_VR_PLUGIN = "https://assetstore.unity.com/packages/slug/82022?" ;
419420 private const string OCULUS_ANDROID_PACKAGE_NAME = "com.unity.xr.oculus.android" ;
421+ public const AndroidSdkVersions MIN_SUPPORTED_ANDROID_SDK_VERSION =
422+ #if UNITY_2020_1_OR_NEWER
423+ AndroidSdkVersions . AndroidApiLevel22 ;
424+ #else
425+ AndroidSdkVersions . AndroidApiLevel21 ;
426+ #endif
420427
421428 public static bool canSupportOculusGo
422429 {
@@ -502,7 +509,7 @@ public override bool support
502509 get
503510 {
504511 if ( ! canSupport ) { return false ; }
505- if ( PlayerSettings . Android . minSdkVersion < AndroidSdkVersions . AndroidApiLevel21 ) { return false ; }
512+ if ( PlayerSettings . Android . minSdkVersion < MIN_SUPPORTED_ANDROID_SDK_VERSION ) { return false ; }
506513 if ( PlayerSettings . graphicsJobs ) { return false ; }
507514 if ( ( PlayerSettings . colorSpace == ColorSpace . Linear || PlayerSettings . gpuSkinning ) && ! GraphicsAPIContainsOnly ( BuildTarget . Android , GraphicsDeviceType . OpenGLES3 ) ) { return false ; }
508515
@@ -527,9 +534,9 @@ public override bool support
527534 supportWaveVR = false ;
528535 supportDaydream = false ;
529536
530- if ( PlayerSettings . Android . minSdkVersion < AndroidSdkVersions . AndroidApiLevel21 )
537+ if ( PlayerSettings . Android . minSdkVersion < MIN_SUPPORTED_ANDROID_SDK_VERSION )
531538 {
532- PlayerSettings . Android . minSdkVersion = AndroidSdkVersions . AndroidApiLevel21 ;
539+ PlayerSettings . Android . minSdkVersion = MIN_SUPPORTED_ANDROID_SDK_VERSION ;
533540 }
534541
535542 PlayerSettings . graphicsJobs = false ;
0 commit comments