Skip to content

Commit 9ef0203

Browse files
committed
disable "Install Unity Integration" button if dropdown empty
1 parent ba107f9 commit 9ef0203

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ public override void OnInspectorGUI() {
178178

179179
EditorGUILayout.Space();
180180

181-
181+
// disable button if no 3D application is available
182+
EditorGUI.BeginDisabledGroup (ExportSettings.IsDCCDropdownEmpty()? true : false);
182183
var installIntegrationContent = new GUIContent(
183184
"Install Unity Integration",
184185
"Install and configure the Unity integration for the selected 3D application so that you can import and export directly with this project.");
185186
if (GUILayout.Button (installIntegrationContent)) {
186187
FbxExporters.Editor.IntegrationsUI.InstallDCCIntegration ();
187188
}
189+
EditorGUI.EndDisabledGroup ();
188190

189191
GUILayout.FlexibleSpace ();
190192
GUILayout.EndScrollView ();
@@ -729,7 +731,12 @@ public static string GetSelectedDCCPath()
729731

730732
public static string GetSelectedDCCName()
731733
{
732-
return (instance.dccOptionPaths.Count>0) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
734+
return (instance.dccOptionNames.Count>0) ? instance.dccOptionNames [instance.selectedDCCApp] : "";
735+
}
736+
737+
public static bool IsDCCDropdownEmpty()
738+
{
739+
return instance.dccOptionPaths.Count <= 0;
733740
}
734741

735742
/// <summary>

0 commit comments

Comments
 (0)