void UpdateBuildSettings()
 {
     if (GUILayout.Button("Update Build Settings"))
     {
         XRBuildSettings.UpdateBuildSettings();
     }
 }
    void OnGUI()
    {
        //bool build = false;
        using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
        {
            if (ToolbarButton("New", "Create a new test scene."))
            {
                SceneHelper.CreateNewTestScene();
                return;
            }

            if (ToolbarButton("Refresh", "Refresh the list of tests, in case tests that were added/removed are not reflected in the list."))
            {
                PopulateTestEntries();
            }

            GUILayout.FlexibleSpace();

            bool override_toggle = ToolbarToggle(BuildOverride.override_build, "Update Scene List", "True to override the scenes in the Build Setting's scene list with the settings below.");
            if (override_toggle != BuildOverride.override_build)
            {
                XRBuildSettings.UpdateBuildSettings();
                //BuildOverride.SetOverride(override_toggle);
            }
        }


        DrawTestList();
    }
Example #3
0
    void CopyProjectSettings(string outputProjectPath, string rootPath)
    {
        // This method changes build settings so our EditorBuildSettings asset just has the one scene,
        // so we need to make sure that no matter what we update our build settings back to the way
        // they should be for the suite.
        try
        {
            EditorBuildSettings.scenes = new[]
            {
                new EditorBuildSettingsScene(m_ExportTestScenePath, true),
            };
            AssetDatabase.SaveAssets();

            var outputProjectSettings = Path.Combine(outputProjectPath, "ProjectSettings");
            Directory.CreateDirectory(outputProjectSettings);
            foreach (var file in Directory.GetFiles(Path.Combine(rootPath, "ProjectSettings")))
            {
                var destFile = Path.Combine(outputProjectSettings, Path.GetFileName(file));
                File.Copy(file, destFile);
            }
        }
        finally
        {
            XRBuildSettings.UpdateBuildSettings();
        }
    }