示例#1
0
        static void CheckVuforiaConfigurationForEyewearSettings(BuildTargetGroup buildTargetGroup)
        {
            VuforiaConfiguration vuforiaConfiguration = VuforiaConfigurationEditor.LoadConfigurationObject();

            DigitalEyewearARController.EyewearType             eyewearType   = vuforiaConfiguration.DigitalEyewear.EyewearType;
            DigitalEyewearARController.SeeThroughConfiguration opticalConfig = vuforiaConfiguration.DigitalEyewear.SeeThroughConfiguration;

            switch (buildTargetGroup)
            {
            case BuildTargetGroup.Android:
                if (eyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough ||
                    (eyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough &&
                     opticalConfig == DigitalEyewearARController.SeeThroughConfiguration.Vuforia))
                {
                    EnableVR(buildTargetGroup);
                }
                break;

            case BuildTargetGroup.iOS:
                if (eyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough)
                {
                    EnableVR(buildTargetGroup);
                }
                break;

            case BuildTargetGroup.WSA:
                if (eyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough &&
                    opticalConfig == DigitalEyewearARController.SeeThroughConfiguration.HoloLens)
                {
                    EnableVR(buildTargetGroup);
                }
                break;
            }
        }
        static void UpdatePluginSettings()
        {
            // Unregister callback (executed only once)
            EditorApplication.update -= UpdatePluginSettings;

            PluginImporter[] importers = PluginImporter.GetAllImporters();
            foreach (var imp in importers)
            {
                string pluginPath             = imp.assetPath;
                bool   isVuforiaWrapperPlugin =
                    pluginPath.EndsWith("QCARWrapper.dll") || pluginPath.EndsWith("VuforiaWrapper.dll") ||
                    pluginPath.EndsWith("QCARWrapper.bundle") || pluginPath.EndsWith("VuforiaWrapper.bundle");
                if (isVuforiaWrapperPlugin && imp.GetCompatibleWithAnyPlatform())
                {
                    Debug.Log("Setting platform to 'Editor' for plugin: " + pluginPath);
                    imp.SetCompatibleWithAnyPlatform(false);
                    imp.SetCompatibleWithEditor(true);
                }
            }



            // create default Vuforia Configuration and check clipping shader
            var config        = VuforiaConfigurationEditor.LoadConfigurationObject();
            var videoBgConfig = config.VideoBackground;

            if (videoBgConfig.MatteShader == null && videoBgConfig.ClippingMode != HideExcessAreaAbstractBehaviour.CLIPPING_MODE.NONE)
            {
                Undo.RecordObject(config, "Setting Matte Shader");
                videoBgConfig.SetDefaultMatteShader();
                EditorUtility.SetDirty(config);
            }
        }