Skip to content

Commit 1b0a7d4

Browse files
author
AJubrey
committed
[ADDED] some breaks
[ADDED] regular expression to filter out letters to check dccs for their version numbers
1 parent fe5af82 commit 1b0a7d4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ private int ChoosePreferredDCCApp(int optionA, int optionB)
455455
if (appA.StartsWith(s_PreferenceList[i]))
456456
{
457457
scoreA = i;
458+
break;
458459
}
459460
}
460461

@@ -463,6 +464,7 @@ private int ChoosePreferredDCCApp(int optionA, int optionB)
463464
if (appB.StartsWith(s_PreferenceList[i]))
464465
{
465466
scoreB = i;
467+
break;
466468
}
467469
}
468470
return scoreA < scoreB ? optionA : optionB;
@@ -493,13 +495,16 @@ private static int FindDCCVersion(string AppName)
493495
{
494496
return version;
495497
}
496-
else if (AppName.Contains("LT"))
497-
{
498-
int.TryParse(number.Substring(2), out version);
499-
return version;
500-
}
501498
else
502499
{
500+
string AppNameCopy = AppName;
501+
string stringWithoutLetters = System.Text.RegularExpressions.Regex.Replace(AppNameCopy, "[^0-9]", "");
502+
503+
if (int.TryParse(stringWithoutLetters, out version))
504+
{
505+
return version;
506+
}
507+
503508
float fVersion;
504509
//In case we are looking at something with a decimal based version- the int parse will fail so we'll need to parse it as a float.
505510
if (float.TryParse(number, out fVersion))

0 commit comments

Comments
 (0)