void OnEnable()
 {
     titleContent = new GUIContent("XR Tests");
     m_Self       = this;
     PopulateTestEntries();
     BuildOverride.SetOverride(false);
 }
        void DrawBuildSettings()
        {
            BuildTarget new_target = (BuildTarget)EditorGUILayout.EnumPopup(build_target);

            if (new_target != build_target)
            {
                build_target = new_target;
                XRTestsWindow.OverwriteDatabase();
            }
        }
예제 #3
0
    public static void Build(BuildPlayerOptions options)
    {
        if (!BuildPipeline.isBuildingPlayer)
        {
            BuildTarget target    = options.target;// EditorUserBuildSettings.activeBuildTarget;
            bool        is_mobile = !target.ToString().Contains("Standalone");

            if (options.locationPathName != "")
            {
                List <string> scenes = new List <string>();
                foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes)
                {
                    string scene_name = Path.GetFileNameWithoutExtension(scene.path);
                    XRTestsWindow.TestEntryUI entry = XRTestsWindow.GetEntryByName(scene_name);
                    if (entry != null)      //Scene in build settings was also in the scene property database
                    {
                        //Check the entry for build target exclusion, skip if excluded.
                        if (is_mobile && entry.build_target == XRTestsWindow.TestEntryUI.BuildTarget.Standalone)
                        {
                            Debug.Log("Skipping " + scene_name + " for mobile.");
                            continue;
                        }
                        else if (!is_mobile && entry.build_target == XRTestsWindow.TestEntryUI.BuildTarget.Mobile)
                        {
                            Debug.Log("Skipping " + scene_name + " for standalone.");
                            continue;
                        }
                        scenes.Add(scene.path);
                    }
                    else
                    {
                        scenes.Add(scene.path);
                    }
                }

                //Output final build list
                string scene_list = "";
                scenes.ForEach(s => scene_list = (scene_list + s + "\n"));
                Debug.Log("Building " + scenes.Count + " scenes to " + target + " at " + options.locationPathName + "\n" + scene_list);

                options.scenes = scenes.ToArray();

                BuildPipeline.BuildPlayer(options);
            }
        }
        else
        {
            Debug.LogWarning("Unity is already building.");
        }
    }
예제 #4
0
 void OnEnable()
 {
     titleContent = new GUIContent("XR Tests");
     m_Self       = this;
     PopulateTestEntries();
 }