Skip to content

Commit df15afe

Browse files
committed
call repair missing scripts from export settings button
1 parent b984c17 commit df15afe

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,29 @@ public override void OnInspectorGUI() {
180180
}
181181
EditorGUI.EndDisabledGroup ();
182182

183+
EditorGUILayout.Space ();
184+
185+
EditorGUI.indentLevel--;
186+
EditorGUILayout.LabelField("Repair Missing Scripts", EditorStyles.boldLabel);
187+
EditorGUI.indentLevel++;
188+
189+
EditorGUILayout.Space ();
190+
191+
var repairMissingScripts = new GUIContent (
192+
"Repair Missing Scripts",
193+
"Repair missing FbxPrefab scripts in text assets");
194+
if (GUILayout.Button (repairMissingScripts)) {
195+
bool result = FbxExporters.Editor.RepairMissingScripts.ReplaceGUIDInTextAssets ();
196+
if (result) {
197+
UnityEditor.EditorUtility.DisplayDialog ("Finished Repairing Scripts",
198+
"Repaired missing scripts in text serialized assets", "Ok");
199+
} else {
200+
UnityEditor.EditorUtility.DisplayDialog ("Finished Repairing Scripts",
201+
"Couldn't find any assets needing repair", "Ok");
202+
}
203+
}
204+
205+
183206
GUILayout.FlexibleSpace ();
184207
GUILayout.EndScrollView ();
185208
GUILayout.EndVertical();

Assets/FbxExporters/Editor/FbxExporterRepairMissingScripts.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ private static string CurrentPackageSearchID {
3838
}
3939
}
4040

41-
[MenuItem ("File/Repair Missing Scripts", false)]
42-
public static void Menu ()
43-
{
44-
ReplaceGUIDInTextAssets ();
45-
}
46-
47-
private static bool ReplaceGUIDInTextAssets ()
41+
public static bool ReplaceGUIDInTextAssets ()
4842
{
4943
// search project for assets containing old GUID
5044

0 commit comments

Comments
 (0)