private void DoInspectorLoaderGUI(NodeGUI node) { if (node.Data.LoaderLoadPath == null) { return; } EditorGUILayout.HelpBox("Loader: Load assets in given directory path.", MessageType.Info); UpdateNodeName(node); GUILayout.Space(10f); //Show target configuration tab DrawPlatformSelector(node); using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { var disabledScope = DrawOverrideTargetToggle(node, node.Data.LoaderLoadPath.ContainsValueOf(currentEditingGroup), (bool b) => { using (new RecordUndoScope("Remove Target Load Path Settings", node, true)) { if (b) { node.Data.LoaderLoadPath[currentEditingGroup] = node.Data.LoaderLoadPath.DefaultValue; } else { node.Data.LoaderLoadPath.Remove(currentEditingGroup); } } }); using (disabledScope) { EditorGUILayout.LabelField("Load Path:"); var newLoadPath = EditorGUILayout.TextField( SystemDataUtility.GetProjectName() + AssetBundleGraphSettings.ASSETS_PATH, node.Data.LoaderLoadPath[currentEditingGroup] ); if (newLoadPath != node.Data.LoaderLoadPath[currentEditingGroup]) { using (new RecordUndoScope("Load Path Changed", node, true)){ node.Data.LoaderLoadPath[currentEditingGroup] = newLoadPath; } } } } }
private void DoInspectorExporterGUI(NodeGUI node) { if (node.exportTo == null) { return; } EditorGUILayout.HelpBox("Exporter: Export given files to output directory.", MessageType.Info); UpdateNodeName(node); GUILayout.Space(10f); node.currentPlatform = UpdateCurrentPlatform(node.currentPlatform); using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { EditorGUILayout.LabelField("Export Path:"); var newExportPath = EditorGUILayout.TextField( SystemDataUtility.GetProjectName(), SystemDataUtility.GetPlatformValue( node.exportTo.ReadonlyDict(), node.currentPlatform ).ToString() ); var exporterrNodePath = FileUtility.GetPathWithProjectPath(newExportPath); if (IntegratedGUIExporter.ValidateExportPath( newExportPath, exporterrNodePath, () => { // TODO Make text field bold }, () => { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(exporterrNodePath + " does not exist."); if (GUILayout.Button("Create directory")) { Directory.CreateDirectory(exporterrNodePath); node.Save(); } } EditorGUILayout.Space(); EditorGUILayout.LabelField("Available Directories:"); string[] dirs = Directory.GetDirectories(Path.GetDirectoryName(exporterrNodePath)); foreach (string s in dirs) { EditorGUILayout.LabelField(s); } } )) { using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); #if UNITY_EDITOR_OSX string buttonName = "Reveal in Finder"; #else string buttonName = "Show in Explorer"; #endif if (GUILayout.Button(buttonName)) { EditorUtility.RevealInFinder(exporterrNodePath); } } } if (newExportPath != SystemDataUtility.GetPlatformValue( node.exportTo.ReadonlyDict(), node.currentPlatform ).ToString() ) { node.BeforeSave(); node.exportTo.Add(SystemDataUtility.CreateKeyNameFromString(node.currentPlatform), newExportPath); node.Save(); } } UpdateDeleteSetting(node); }
private void DoInspectorLoaderGUI(NodeGUI node) { if (node.loadPath == null) { return; } EditorGUILayout.HelpBox("Loader: Load assets in given directory path.", MessageType.Info); UpdateNodeName(node); GUILayout.Space(10f); /* * platform & package */ if (packageEditMode) { EditorGUI.BeginDisabledGroup(true); } // update platform & package. node.currentPlatform = UpdateCurrentPlatform(node.currentPlatform); using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { EditorGUILayout.LabelField("Load Path:"); var newLoadPath = EditorGUILayout.TextField( SystemDataUtility.GetProjectName() + AssetBundleGraphSettings.ASSETS_PATH, SystemDataUtility.GetPlatformValue( node.loadPath.ReadonlyDict(), node.currentPlatform ).ToString() ); var loaderNodePath = FileUtility.GetPathWithAssetsPath(newLoadPath); IntegratedGUILoader.ValidateLoadPath( newLoadPath, loaderNodePath, () => { //EditorGUILayout.HelpBox("load path is empty.", MessageType.Error); }, () => { //EditorGUILayout.HelpBox("Directory not found:" + loaderNodePath, MessageType.Error); } ); if (newLoadPath != SystemDataUtility.GetPlatformValue( node.loadPath.ReadonlyDict(), node.currentPlatform ).ToString() ) { node.BeforeSave(); node.loadPath.Add(SystemDataUtility.CreateKeyNameFromString(node.currentPlatform), newLoadPath); node.Save(); } } if (packageEditMode) { EditorGUI.EndDisabledGroup(); } UpdateDeleteSetting(node); }
private void DoInspectorExporterGUI(NodeGUI node) { if (node.Data.ExporterExportPath == null) { return; } EditorGUILayout.HelpBox("Exporter: Export given files to output directory.", MessageType.Info); UpdateNodeName(node); GUILayout.Space(10f); //Show target configuration tab DrawPlatformSelector(node); using (new EditorGUILayout.VerticalScope(GUI.skin.box)) { var disabledScope = DrawOverrideTargetToggle(node, node.Data.ExporterExportPath.ContainsValueOf(currentEditingGroup), (bool enabled) => { using (new RecordUndoScope("Remove Target Export Settings", node, true)){ if (enabled) { node.Data.ExporterExportPath[currentEditingGroup] = node.Data.ExporterExportPath.DefaultValue; } else { node.Data.ExporterExportPath.Remove(currentEditingGroup); } } }); using (disabledScope) { EditorGUILayout.LabelField("Export Path:"); var newExportPath = EditorGUILayout.TextField( SystemDataUtility.GetProjectName(), node.Data.ExporterExportPath[currentEditingGroup] ); var exporterrNodePath = FileUtility.GetPathWithProjectPath(newExportPath); if (IntegratedGUIExporter.ValidateExportPath( newExportPath, exporterrNodePath, () => { // TODO Make text field bold }, () => { using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.LabelField(exporterrNodePath + " does not exist."); if (GUILayout.Button("Create directory")) { using (new SaveScope(node)) { Directory.CreateDirectory(exporterrNodePath); } } } EditorGUILayout.Space(); EditorGUILayout.LabelField("Available Directories:"); string[] dirs = Directory.GetDirectories(Path.GetDirectoryName(exporterrNodePath)); foreach (string s in dirs) { EditorGUILayout.LabelField(s); } } )) { using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); #if UNITY_EDITOR_OSX string buttonName = "Reveal in Finder"; #else string buttonName = "Show in Explorer"; #endif if (GUILayout.Button(buttonName)) { EditorUtility.RevealInFinder(exporterrNodePath); } } } if (newExportPath != node.Data.ExporterExportPath[currentEditingGroup]) { using (new RecordUndoScope("Change Export Path", node, true)){ node.Data.ExporterExportPath[currentEditingGroup] = newExportPath; } } } } }