public void OnPreprocessBuild(BuildReport report)
        {
            SetRuntimePluginCopyDelegate();

            if (report.summary.platform != BuildTarget.Android)
            {
                // Sometimes (e.g., build failure), the shader can get "stuck" in the Preloaded Assets array.
                // Make sure that if we are not building for Android, we remove that shader.
                BuildHelper.RemoveShaderFromProject(ARCoreCameraSubsystem.backgroundShaderName);
                return;
            }

            var generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget));

            if (generalSettings == null)
            {
                return;
            }

            foreach (var loader in generalSettings.Manager.loaders)
            {
                if (loader is ARCoreLoader)
                {
                    EnsureARCoreSupportedIsNotChecked();
                    EnsureGoogleARCoreIsNotPresent();
                    EnsureMinSdkVersion();
                    EnsureOnlyOpenGLES3IsUsed();
                    EnsureGradleIsUsed();
                    EnsureGradleVersionIsSupported();
                    BuildImageTrackingAssets();
                    BuildHelper.AddBackgroundShaderToProject(ARCoreCameraSubsystem.backgroundShaderName);
                    break;
                }
            }
        }
            public void OnPreprocessBuild(BuildReport report)
            {
                if (report.summary.platform != BuildTarget.iOS)
                {
                    return;
                }

                if (string.IsNullOrEmpty(PlayerSettings.iOS.cameraUsageDescription))
                {
                    throw new BuildFailedException("ARKit requires a Camera Usage Description (Player Settings > iOS > Other Settings > Camera Usage Description)");
                }

                SelectStaticLib();

                EnsureMetalIsFirstApi();

                if (ARKitSettings.GetOrCreateSettings().requirement == ARKitSettings.Requirement.Required)
                {
                    EnsureMinimumBuildTarget();
                    EnsureTargetArchitecturesAreSupported(report.summary.platformGroup);
                }
                else if (PlayerSettings.GetArchitecture(report.summary.platformGroup) == k_TargetArchitectureUniversal)
                {
                    EnsureOpenGLIsUsed();
                }

                BuildHelper.AddBackgroundShaderToProject(ARKitCameraSubsystem.backgroundShaderName);
            }
        public void OnPreprocessBuild(BuildReport report)
        {
            SetRuntimePluginCopyDelegate();

            if (report.summary.platform != BuildTarget.Android)
            {
                return;
            }

            XRGeneralSettings generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget));

            if (generalSettings == null)
            {
                return;
            }

            foreach (var loader in generalSettings.Manager.loaders)
            {
                if (loader is ARCoreLoader)
                {
                    EnsureARCoreSupportedIsNotChecked();
                    EnsureGoogleARCoreIsNotPresent();
                    EnsureMinSdkVersion();
                    EnsureOnlyOpenGLES3IsUsed();
                    EnsureGradleIsUsed();
                    BuildImageTrackingAssets();
                    BuildHelper.AddBackgroundShaderToProject(ARCoreCameraSubsystem.backgroundShaderName);
                    break;
                }
            }
        }
Пример #4
0
        public void OnPreprocessBuild(BuildReport report)
        {
            if (report.summary.platform != BuildTarget.Android)
            {
                return;
            }

            EnsureARCoreSupportedIsNotChecked();
            EnsureGoogleARCoreIsNotPresent();
            EnsureMinSdkVersion();
            EnsureOnlyOpenGLES3IsUsed();
            EnsureGradleIsUsed();
            BuildImageTrackingAssets();

            BuildHelper.AddBackgroundShaderToProject(ARCoreCameraSubsystem.backgroundShaderName);
        }
        public void OnPreprocessBuild(BuildReport report)
        {
            if (report.summary.platform != BuildTarget.Android)
            {
                // Sometimes (e.g., build failure), the shader can get "stuck" in the Preloaded Assets array.
                // Make sure that if we are not building for Android, we remove that shader.
                BuildHelper.RemoveShaderFromProject(ARCoreCameraSubsystem.backgroundShaderName);
                return;
            }

            EnsureARCoreSupportedIsNotChecked();
            EnsureGoogleARCoreIsNotPresent();
            EnsureMinSdkVersion();
            EnsureOnlyOpenGLES3IsUsed();
            EnsureGradleIsUsed();
            BuildImageTrackingAssets();

            BuildHelper.AddBackgroundShaderToProject(ARCoreCameraSubsystem.backgroundShaderName);
        }
Пример #6
0
            public void OnPreprocessBuild(BuildReport report)
            {
                if (report.summary.platform != BuildTarget.iOS)
                {
                    return;
                }

                if (string.IsNullOrEmpty(PlayerSettings.iOS.cameraUsageDescription))
                {
                    throw new BuildFailedException("ARKit requires a Camera Usage Description (Player Settings > iOS > Other Settings > Camera Usage Description)");
                }

                SelectStaticLib();
                EnsureMinimumBuildTarget();
                EnsureOnlyMetalIsUsed();
                EnsureTargetArchitecturesAreSupported(report.summary.platformGroup);

                BuildHelper.AddBackgroundShaderToProject(ARKitCameraSubsystem.backgroundShaderName);
            }