@@ -179,7 +179,7 @@ public override void OnInspectorGUI() {
179
179
EditorGUILayout . Space ( ) ;
180
180
181
181
// disable button if no 3D application is available
182
- EditorGUI . BeginDisabledGroup ( ExportSettings . IsDCCDropdownEmpty ( ) ? true : false ) ;
182
+ EditorGUI . BeginDisabledGroup ( ExportSettings . CanInstall ( ) ? true : false ) ;
183
183
var installIntegrationContent = new GUIContent (
184
184
"Install Unity Integration" ,
185
185
"Install and configure the Unity integration for the selected 3D application so that you can import and export directly with this project." ) ;
@@ -602,8 +602,7 @@ public static GUIContent[] GetDCCOptions(){
602
602
FindDCCInstalls ( ) ;
603
603
}
604
604
// store the selected app if any
605
- string prevSelection = instance . dccOptionPaths . Count > 0 && instance . selectedDCCApp >= 0 ?
606
- instance . dccOptionPaths [ instance . selectedDCCApp ] : null ;
605
+ string prevSelection = GetSelectedDCCPath ( ) ;
607
606
608
607
// remove options that no longer exist
609
608
List < string > pathsToDelete = new List < string > ( ) ;
@@ -726,15 +725,19 @@ public static bool IsEarlierThanMax2017(string AppName){
726
725
727
726
public static string GetSelectedDCCPath ( )
728
727
{
729
- return ( instance . dccOptionPaths . Count > 0 ) ? instance . dccOptionPaths [ instance . selectedDCCApp ] : "" ;
728
+ return ( instance . dccOptionPaths . Count > 0 &&
729
+ instance . selectedDCCApp >= 0 &&
730
+ instance . selectedDCCApp < instance . dccOptionPaths . Count ) ? instance . dccOptionPaths [ instance . selectedDCCApp ] : "" ;
730
731
}
731
732
732
733
public static string GetSelectedDCCName ( )
733
734
{
734
- return ( instance . dccOptionNames . Count > 0 ) ? instance . dccOptionNames [ instance . selectedDCCApp ] : "" ;
735
+ return ( instance . dccOptionNames . Count > 0 &&
736
+ instance . selectedDCCApp >= 0 &&
737
+ instance . selectedDCCApp < instance . dccOptionNames . Count ) ? instance . dccOptionNames [ instance . selectedDCCApp ] : "" ;
735
738
}
736
739
737
- public static bool IsDCCDropdownEmpty ( )
740
+ public static bool CanInstall ( )
738
741
{
739
742
return instance . dccOptionPaths . Count <= 0 ;
740
743
}
0 commit comments