コード例 #1
0
        /// <summary>
        ///     Removes all the elements of the framework that were deployed via spatial build.
        /// </summary>
        private static void CleanDeployedFramework()
        {
            var pluginDirectories = Directory.GetDirectories(EditorPaths.PluginDirectory, EditorPaths.OrganizationName, SearchOption.AllDirectories);
            var directoriesToClean = new[] { EditorPaths.AssetDirectory }.Union(pluginDirectories);

            foreach (var directory in directoriesToClean)
            {
                try
                {
                    UnityPathUtil.EnsureDirectoryRemoved(directory);
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }
            }
        }
コード例 #2
0
 public void Clean()
 {
     UnityPathUtil.EnsureDirectoryRemoved(PackagePath);
     UnityPathUtil.EnsureFileRemoved(ZipPath + ".zip");
 }
コード例 #3
0
        /// <inheritdoc cref="ISpatialOsEditorAddon" />
        public void OnDevGui(Rect rect)
        {
            using (new EditorGUILayout.VerticalScope())
            {
                DrawWorkerTargetSelection();

                using (new EditorGUI.DisabledScope(!SpatialOsEditor.WorkerSelection.AnyWorkersSelected || buildTargets == null || buildTargets.Count == 0))
                {
                    using (new EditorGUILayout.VerticalScope())
                    {
                        GUILayout.Label("Generate from schema", EditorStyles.boldLabel);

                        using (new EditorGUILayout.HorizontalScope())
                        {
                            if (GUILayout.Button(new GUIContent("Build", "Generate code for the currently selected workers."), EditorStyles.toolbarButton))
                            {
                                CodegenWorkers();
                            }

                            if (GUILayout.Button(new GUIContent("Cleanup", "Generate code for the currently selected workers."), EditorStyles.toolbarButton))
                            {
                                CleanupCodegen();
                            }
                        }
                    }

                    EditorGUILayout.Separator();

                    using (new EditorGUILayout.VerticalScope())
                    {
                        GUILayout.Label("Entity prefabs", EditorStyles.boldLabel);

                        using (new EditorGUILayout.HorizontalScope())
                        {
                            if (GUILayout.Button(new GUIContent("Build all", "Build entity prefabs for the selected workers and targets."), EditorStyles.toolbarButton))
                            {
                                ExportPrefabs();
                            }

                            using (new EditorGUI.DisabledScope(!EntityPrefabExporter.AnyPrefabsSelected()))
                            {
                                if (GUILayout.Button(new GUIContent("Build selected", "Build selected entity prefabs for the selected workers and targets."), EditorStyles.toolbarButton))
                                {
                                    ExportSelectedPrefabs();
                                }
                            }

                            if (GUILayout.Button("Cleanup all", EditorStyles.toolbarButton))
                            {
                                EntityPrefabExportMenus.OnCleanEntityPrefabs();
                            }
                        }
                    }

                    EditorGUILayout.Separator();

                    using (new EditorGUILayout.VerticalScope())
                    {
                        GUILayout.Label("Workers", EditorStyles.boldLabel);

                        using (new EditorGUILayout.HorizontalScope())
                        {
                            if (GUILayout.Button(new GUIContent("Build", "Build the currently selected workers."), EditorStyles.toolbarButton))
                            {
                                EditorApplication.update += EditorUpdate;
                            }

                            if (GUILayout.Button(new GUIContent("Cleanup all", "Clean all workers."), EditorStyles.toolbarButton))
                            {
                                UnityPathUtil.EnsureDirectoryClean(UnityPlayerBuilder.PlayerBuildDirectory);
                                UnityPathUtil.EnsureDirectoryClean(UnityPlayerBuilder.PlayerBuildScratchDirectory);
                            }
                        }
                    }
                }
            }
        }