@@ -180,27 +180,33 @@ public override void OnInspectorGUI() {
180
180
}
181
181
EditorGUI . EndDisabledGroup ( ) ;
182
182
183
- if ( ! HideRepairMissingScripts ( ) ) {
184
- EditorGUILayout . Space ( ) ;
185
-
186
- EditorGUI . indentLevel -- ;
187
- EditorGUILayout . LabelField ( "Repair Missing Scripts" , EditorStyles . boldLabel ) ;
188
- EditorGUI . indentLevel ++ ;
183
+ EditorGUILayout . Space ( ) ;
189
184
190
- EditorGUILayout . Space ( ) ;
185
+ EditorGUI . indentLevel -- ;
186
+ EditorGUILayout . LabelField ( "Run Component Updater" , EditorStyles . boldLabel ) ;
187
+ EditorGUI . indentLevel ++ ;
191
188
192
- var repairMissingScripts = new GUIContent (
193
- "Repair Missing Scripts" ,
194
- "Repair missing FbxPrefab scripts in text assets" ) ;
195
- if ( GUILayout . Button ( repairMissingScripts ) ) {
196
- bool result = FbxExporters . Editor . RepairMissingScripts . ReplaceGUIDInTextAssets ( ) ;
189
+ EditorGUILayout . Space ( ) ;
190
+
191
+ var repairMissingScripts = new GUIContent (
192
+ "Run Component Updater" ,
193
+ "Repair missing FbxPrefab scripts in text assets" ) ;
194
+ if ( GUILayout . Button ( repairMissingScripts ) ) {
195
+ var componentUpdater = new FbxExporters . Editor . RepairMissingScripts ( ) ;
196
+ var filesToRepairCount = componentUpdater . GetAssetsToRepairCount ( ) ;
197
+ if ( filesToRepairCount > 0 ) {
198
+ bool result = UnityEditor . EditorUtility . DisplayDialog ( "Component Updater" ,
199
+ string . Format ( "Found {0} text assets with components requiring update.\n \n " +
200
+ "If you choose 'Go Ahead', the components in these text serialized assets " +
201
+ "will be automatically updated to work with the latest FBX exporter.\n " +
202
+ "You should make a backup before proceeding." , filesToRepairCount ) ,
203
+ "I Made a Backup. Go Ahead!" , "No Thanks" ) ;
197
204
if ( result ) {
198
- UnityEditor . EditorUtility . DisplayDialog ( "Finished Repairing Scripts" ,
199
- "Repaired missing scripts in text serialized assets" , "Ok" ) ;
200
- } else {
201
- UnityEditor . EditorUtility . DisplayDialog ( "Finished Repairing Scripts" ,
202
- "Couldn't find any assets needing repair" , "Ok" ) ;
205
+ componentUpdater . ReplaceGUIDInTextAssets ( ) ;
203
206
}
207
+ } else {
208
+ UnityEditor . EditorUtility . DisplayDialog ( "Component Updater" ,
209
+ "Couldn't find any text assets requiring update" , "Ok" ) ;
204
210
}
205
211
}
206
212
@@ -214,11 +220,6 @@ public override void OnInspectorGUI() {
214
220
}
215
221
}
216
222
217
- private static bool HideRepairMissingScripts ( ) {
218
- var docPath = Application . dataPath + "/FbxExporters/FBX_Exporter_User_Guide_v1.1.0b1.pdf" ;
219
- return File . Exists ( docPath ) ? false : true ;
220
- }
221
-
222
223
private static string TryFindDCC ( string dccPath , string ext , ExportSettings . DCCType dccType ) {
223
224
string dccName = "" ;
224
225
switch ( dccType ) {
0 commit comments