Skip to content

Commit 844ce4f

Browse files
author
AJubrey
committed
[ADDED] added non-functional integrations path field
1 parent dd2a56b commit 844ce4f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,55 @@ public override void OnInspectorGUI() {
8787
}
8888
GUILayout.EndHorizontal ();
8989

90+
GUILayout.BeginHorizontal ();
91+
GUILayout.Label (new GUIContent (
92+
"Integrations Path:",
93+
"Relative path for saving 3D application integrations."), GUILayout.Width(LabelWidth - 3));
94+
95+
var IntegrationsPathLabel = ExportSettings.GetRelativeSavePath();
96+
if (IntegrationsPathLabel == ".") { IntegrationsPathLabel = "(Assets root)"; }
97+
EditorGUILayout.SelectableLabel(IntegrationsPathLabel,
98+
EditorStyles.textField,
99+
GUILayout.MinWidth(SelectableLabelMinWidth),
100+
GUILayout.Height(EditorGUIUtility.singleLineHeight));
101+
102+
if (GUILayout.Button(new GUIContent("...", "Browse to a new location for saving model prefabs"), EditorStyles.miniButton, GUILayout.Width(BrowseButtonWidth)))
103+
{
104+
string initialPath = ExportSettings.GetAbsoluteSavePath();
105+
106+
// if the directory doesn't exist, set it to the default save path
107+
// so we don't open somewhere unexpected
108+
if (!System.IO.Directory.Exists(initialPath))
109+
{
110+
initialPath = Application.dataPath;
111+
}
112+
113+
string fullPath = EditorUtility.OpenFolderPanel(
114+
"Select Model Prefabs Path", initialPath, null
115+
);
116+
117+
// Unless the user canceled, make sure they chose something in the Assets folder.
118+
if (!string.IsNullOrEmpty(fullPath))
119+
{
120+
var relativePath = ExportSettings.ConvertToAssetRelativePath(fullPath);
121+
if (string.IsNullOrEmpty(relativePath))
122+
{
123+
Debug.LogWarning("Please select a location in the Assets folder");
124+
}
125+
else
126+
{
127+
ExportSettings.SetRelativeSavePath(relativePath);
128+
129+
// Make sure focus is removed from the selectable label
130+
// otherwise it won't update
131+
GUIUtility.hotControl = 0;
132+
GUIUtility.keyboardControl = 0;
133+
}
134+
}
135+
}
136+
137+
GUILayout.EndHorizontal();
138+
90139
EditorGUILayout.Space ();
91140

92141
GUILayout.BeginHorizontal ();

0 commit comments

Comments
 (0)