Skip to content

Commit 36ad83b

Browse files
author
AJubrey
committed
[ADDED] function to check for variables in our settings file that could possibly be missing
1 parent e63f3d4 commit 36ad83b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,9 @@ protected virtual void Load()
10221022
LoadDefaults();
10231023
} else {
10241024
try {
1025-
var fileData = System.IO.File.ReadAllText(filePath);
1025+
var fileData = System.IO.File.ReadAllText(filePath);
10261026
EditorJsonUtility.FromJsonOverwrite(fileData, s_Instance);
1027+
checkForNewVariables(fileData);
10271028
} catch(Exception xcp) {
10281029
// Quash the exception and take the default settings.
10291030
Debug.LogException(xcp);
@@ -1032,6 +1033,19 @@ protected virtual void Load()
10321033
}
10331034
}
10341035

1036+
/// <summary>
1037+
/// Check the FBXSettings for any variables we don't know about yet. (in case we are using a new version of the importer)
1038+
/// We'll want to update this with any new significant UI options.
1039+
/// </summary>
1040+
/// <param name="FileData"></param>
1041+
private void checkForNewVariables(string FileData)
1042+
{
1043+
if (!FileData.Contains("HideSendToUnityMenu"))
1044+
{
1045+
ExportSettings.instance.HideSendToUnityMenu = true;
1046+
}
1047+
}
1048+
10351049
protected virtual void Save(bool saveAsText)
10361050
{
10371051
if (s_Instance == null)

0 commit comments

Comments
 (0)