Example #1
0
        /// <summary>OnPostprocessBuild override to provide XR Plugin specific build actions.</summary>
        /// <param name="report">The build report.</param>
        public override void OnPostprocessBuild(BuildReport report)
        {
            if (!IsCurrentBuildTargetVaild(report))
            {
                return;
            }

            if (!HasLoaderEnabledForTarget(report.summary.platformGroup))
            {
                return;
            }

            BootConfig bootConfig = new BootConfig(report);

            bootConfig.ReadBootConfg();

            bootConfig.ClearEntryForKey(k_ForcePrimaryWindowHolographic);
            bootConfig.ClearEntryForKey(k_VrEnabled);
            bootConfig.ClearEntryForKey(k_WmrLibrary);
            bootConfig.ClearEntryForKey(k_WmrLibraryName);
            bootConfig.ClearEntryForKey(k_EarlyBootHolographic);

            bootConfig.WriteBootConfig();

            base.OnPostprocessBuild(report);
        }
Example #2
0
        /// <summary>OnPostprocessBuild override to provide XR Plugin specific build actions.</summary>
        /// <param name="report">The build report.</param>
        public override void OnPostprocessBuild(BuildReport report)
        {
            if (!IsCurrentBuildTargetVaild(report))
            {
                return;
            }

            if (!HasLoaderEnabledForTarget(report.summary.platformGroup))
            {
                return;
            }

            base.OnPostprocessBuild(report);

            BootConfig bootConfig = new BootConfig(report);

            bootConfig.ReadBootConfg();

            bootConfig.SetValueForKey(k_VrEnabled, "1", true);
            bootConfig.SetValueForKey(k_WmrLibrary, k_WmrLibraryName, true);
            if (report.summary.platformGroup == BuildTargetGroup.WSA)
            {
                bootConfig.SetValueForKey(k_EarlyBootHolographic, "1", true);

                bool usePrimaryWindow = true;
                WindowsMRBuildSettings buildSettings = BuildSettingsForBuildTargetGroup(report.summary.platformGroup);
                if (buildSettings != null)
                {
                    usePrimaryWindow = buildSettings.UsePrimaryWindowForDisplay;
                }

                bootConfig.SetValueForKey(k_ForcePrimaryWindowHolographic, usePrimaryWindow ? "1" : "0", true);
            }


            bootConfig.WriteBootConfig();
        }
        /// <summary>OnPreprocessBuild override to provide XR Plugin specific build actions.</summary>
        /// <param name="report">The build report.</param>
        public override void OnPreprocessBuild(BuildReport report)
        {
            if (IsCurrentBuildTargetVaild(report) && HasLoaderEnabledForTarget(report.summary.platformGroup))
            {
                base.OnPreprocessBuild(report);

                BootConfig bootConfig = new BootConfig(report);
                bootConfig.ReadBootConfg();

                bootConfig.SetValueForKey(k_VrEnabled, "1", true);
                bootConfig.SetValueForKey(k_WmrLibrary, k_WmrLibraryName, true);
                if (report.summary.platformGroup == BuildTargetGroup.WSA)
                {
                    bootConfig.SetValueForKey(k_EarlyBootHolographic, "1", true);

                    bool usePrimaryWindow = true;
                    WindowsMRBuildSettings buildSettings = BuildSettingsForBuildTargetGroup(report.summary.platformGroup);
                    if (buildSettings != null)
                    {
                        usePrimaryWindow = buildSettings.UsePrimaryWindowForDisplay;
                    }

                    bootConfig.SetValueForKey(k_ForcePrimaryWindowHolographic, usePrimaryWindow ? "1" : "0", true);
                }


                bootConfig.WriteBootConfig();
            }


            var allPlugins = PluginImporter.GetAllImporters();

            foreach (var plugin in allPlugins)
            {
                if (plugin.isNativePlugin)
                {
                    foreach (var pluginName in remotingPluginNames)
                    {
                        if (plugin.assetPath.Contains(pluginName))
                        {
                            plugin.SetIncludeInBuildDelegate((path) => { return(Internal_ShouldIncludeRemotingPluginsInBuild(path, report.summary.platformGroup)); });
                            break;
                        }
                    }

                    foreach (var pluginName in runtimePluginNames)
                    {
                        if (plugin.assetPath.Contains(pluginName))
                        {
                            plugin.SetIncludeInBuildDelegate((path) => { return(Internal_ShouldIncludeRuntimePluginsInBuild(path, report.summary.platformGroup)); });
                            break;
                        }
                    }

                    if (plugin.assetPath.Contains(spatializerPluginName))
                    {
                        plugin.SetIncludeInBuildDelegate(Internal_ShouldIncludeSpatializerPluginsInBuild);
                    }
                }
            }
        }