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;
}
}
}
}
}