public ScriptingImplementation[] Enabled()
 {
     if (Unsupported.IsDeveloperBuild())
     {
         ScriptingImplementation[] implementationArray1 = new ScriptingImplementation[2];
         implementationArray1[1] = ScriptingImplementation.IL2CPP;
         return implementationArray1;
     }
     return new ScriptingImplementation[1];
 }
 public ScriptingImplementation[] Enabled()
 {
     ScriptingImplementation[] implementationArray1 = new ScriptingImplementation[2];
     implementationArray1[1] = ScriptingImplementation.IL2CPP;
     return implementationArray1;
 }
    static void CheckStaticAndroidIssues()
    {
        if (OVRDeviceSelector.isTargetDeviceQuest && PlayerSettings.Android.targetArchitectures != AndroidArchitecture.ARM64)
        {
            // Quest store is only accepting 64-bit apps as of November 25th 2019
            AddFix("Set Target Architecture to ARM64", "32-bit Quest apps are no longer being accepted on the Oculus Store.",
                   delegate(UnityEngine.Object obj, bool last, int selected)
            {
                PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
            }, null, false, "Fix");
        }

        // Check that the minSDKVersion meets requirement, 21 for Gear and Go, 23 for Quest
        AndroidSdkVersions recommendedAndroidMinSdkVersion = AndroidSdkVersions.AndroidApiLevel21;

        if (OVRDeviceSelector.isTargetDeviceQuest)
        {
            recommendedAndroidMinSdkVersion = AndroidSdkVersions.AndroidApiLevel23;
        }
        if ((int)PlayerSettings.Android.minSdkVersion < (int)recommendedAndroidMinSdkVersion)
        {
            AddFix("Set Min Android API Level", "Please require at least API level " + (int)recommendedAndroidMinSdkVersion, delegate(UnityEngine.Object obj, bool last, int selected)
            {
                PlayerSettings.Android.minSdkVersion = recommendedAndroidMinSdkVersion;
            }, null, false, "Fix");
        }

        // Check that compileSDKVersion meets minimal version 26 as required for Quest's headtracking feature
        // Unity Sets compileSDKVersion in Gradle as the value used in targetSdkVersion
        AndroidSdkVersions requiredAndroidTargetSdkVersion = AndroidSdkVersions.AndroidApiLevel26;

        if (OVRDeviceSelector.isTargetDeviceQuest &&
            (int)PlayerSettings.Android.targetSdkVersion < (int)requiredAndroidTargetSdkVersion)
        {
            AddFix("Set Android Target SDK Level", "Oculus Quest apps require at least target API level " +
                   (int)requiredAndroidTargetSdkVersion, delegate(UnityEngine.Object obj, bool last, int selected)
            {
                PlayerSettings.Android.targetSdkVersion = requiredAndroidTargetSdkVersion;
            }, null, false, "Fix");
        }

        // Check that Android TV Compatibility is disabled
        if (PlayerSettings.Android.androidTVCompatibility)
        {
            AddFix("Disable Android TV Compatibility", "Apps with Android TV Compatibility enabled are not accepted by the Oculus Store.",
                   delegate(UnityEngine.Object obj, bool last, int selected)
            {
                PlayerSettings.Android.androidTVCompatibility = false;
            }, null, false, "Fix");
        }

        if (OVRPlatformToolSettings.TargetPlatform == OVRPlatformTool.TargetPlatform.OculusGoGearVR &&
            !OVRPlugin.supportsGearVR)
        {
            AddFix("Gear VR Not Supported", "Target Oculus Platform Gear VR is no longer supported after Oculus Utilities v1.41.0. " +
                   "This app will only target Oculus Go.", null, null, false);
        }

        if (!PlayerSettings.gpuSkinning)
        {
            AddFix("Optimize GPU Skinning", "If you are CPU-bound, consider using GPU skinning.",
                   delegate(UnityEngine.Object obj, bool last, int selected)
            {
                PlayerSettings.gpuSkinning = true;
            }, null, false, "Fix");
        }


        if (RenderSettings.skybox)
        {
            AddFix("Optimize Clearing", "For GPU performance, please don't use Unity's built-in Skybox.", delegate(UnityEngine.Object obj, bool last, int selected)
            {
                RenderSettings.skybox = null;
            }, null, false, "Clear Skybox");
        }

        var materials = Resources.FindObjectsOfTypeAll <Material>();

        for (int i = 0; i < materials.Length; ++i)
        {
            if (materials[i].IsKeywordEnabled("_SPECGLOSSMAP") || materials[i].IsKeywordEnabled("_METALLICGLOSSMAP"))
            {
                AddFix("Optimize Specular Material", "For GPU performance, please don't use specular shader on materials.", delegate(UnityEngine.Object obj, bool last, int selected)
                {
                    Material thisMaterial = (Material)obj;
                    thisMaterial.DisableKeyword("_SPECGLOSSMAP");
                    thisMaterial.DisableKeyword("_METALLICGLOSSMAP");
                }, materials[i], false, "Fix");
            }

            if (materials[i].passCount > 2)
            {
                AddFix("Material Passes", "Please use 2 or fewer passes in materials.", null, materials[i], false);
            }
        }

        ScriptingImplementation backend = PlayerSettings.GetScriptingBackend(UnityEditor.BuildTargetGroup.Android);

        if (backend != UnityEditor.ScriptingImplementation.IL2CPP)
        {
            AddFix("Optimize Scripting Backend", "For CPU performance, please use IL2CPP.", delegate(UnityEngine.Object obj, bool last, int selected)
            {
                PlayerSettings.SetScriptingBackend(UnityEditor.BuildTargetGroup.Android, UnityEditor.ScriptingImplementation.IL2CPP);
            }, null, false, "Fix");
        }

        var monoBehaviours = GameObject.FindObjectsOfType <MonoBehaviour>();

        System.Type effectBaseType = System.Type.GetType("UnityStandardAssets.ImageEffects.PostEffectsBase");
        if (effectBaseType != null)
        {
            for (int i = 0; i < monoBehaviours.Length; ++i)
            {
                if (monoBehaviours[i].GetType().IsSubclassOf(effectBaseType))
                {
                    AddFix("Image Effects", "Please don't use image effects.", null, monoBehaviours[i], false);
                }
            }
        }

        var textures = Resources.FindObjectsOfTypeAll <Texture2D>();

        int maxTextureSize = 1024 * (1 << QualitySettings.masterTextureLimit);

        maxTextureSize = maxTextureSize * maxTextureSize;

        for (int i = 0; i < textures.Length; ++i)
        {
            if (textures[i].filterMode == FilterMode.Trilinear && textures[i].mipmapCount == 1)
            {
                AddFix("Optimize Texture Filtering", "For GPU performance, please generate mipmaps or disable trilinear filtering for textures.", delegate(UnityEngine.Object obj, bool last, int selected)
                {
                    Texture2D thisTexture = (Texture2D)obj;
                    if (selected == 0)
                    {
                        thisTexture.filterMode = FilterMode.Bilinear;
                    }
                    else
                    {
                        SetTextureUseMips(thisTexture, true, last);
                    }
                }, textures[i], false, "Switch to Bilinear", "Generate Mipmaps");
            }
        }

        var projectors = GameObject.FindObjectsOfType <Projector>();

        if (projectors.Length > 0)
        {
            AddFix("Optimize Projectors", "For GPU performance, please don't use projectors.", delegate(UnityEngine.Object obj, bool last, int selected)
            {
                Projector[] thisProjectors = GameObject.FindObjectsOfType <Projector>();
                for (int i = 0; i < thisProjectors.Length; ++i)
                {
                    thisProjectors[i].enabled = false;
                }
            }, null, false, "Disable Projectors");
        }

        if (EditorUserBuildSettings.androidBuildSubtarget != MobileTextureSubtarget.ASTC)
        {
            AddFix("Optimize Texture Compression", "For GPU performance, please use ASTC.", delegate(UnityEngine.Object obj, bool last, int selected)
            {
                EditorUserBuildSettings.androidBuildSubtarget = MobileTextureSubtarget.ASTC;
            }, null, false, "Fix");
        }

        var cameras    = GameObject.FindObjectsOfType <Camera>();
        int clearCount = 0;

        for (int i = 0; i < cameras.Length; ++i)
        {
            if (cameras[i].clearFlags != CameraClearFlags.Nothing && cameras[i].clearFlags != CameraClearFlags.Depth)
            {
                ++clearCount;
            }
        }

        if (clearCount > 2)
        {
            AddFix("Camera Clears", "Please use 2 or fewer clears.", null, null, false);
        }

        for (int i = 0; i < cameras.Length; ++i)
        {
            if (cameras[i].forceIntoRenderTexture)
            {
                AddFix("Optimize Mobile Rendering", "For GPU performance, please don't enable forceIntoRenderTexture on your camera, this might be a flag pollution created by post process stack you used before, \nif your post process had already been turned off, we strongly encourage you to disable forceIntoRenderTexture. If you still want to use post process for some reasons, \nyou can leave this one on, but be warned, enabling this flag will introduce huge GPU performance cost. To view your flag status, please turn on you inspector's debug mode",
                       delegate(UnityEngine.Object obj, bool last, int selected)
                {
                    Camera thisCamera = (Camera)obj;
                    thisCamera.forceIntoRenderTexture = false;
                }, cameras[i], false, "Disable forceIntoRenderTexture");
            }
        }
    }