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