File tree Expand file tree Collapse file tree 3 files changed +27
-16
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 3 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -237,9 +237,18 @@ public static void UpdateLinkedPrefab(GameObject prefabInstance)
237
237
// Launch the manual update UI to allow the user to fix
238
238
// renamed nodes (or auto-update if there's nothing to rename).
239
239
var fbxPrefabUtility = new FbxPrefabUtility ( fbxPrefabComponent ) ;
240
- ManualUpdateEditorWindow window = ( ManualUpdateEditorWindow ) EditorWindow . GetWindow ( typeof ( ManualUpdateEditorWindow ) ) ;
241
- window . Init ( fbxPrefabUtility , fbxPrefabComponent ) ;
242
- window . Show ( ) ;
240
+
241
+ if ( FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled || runningUnitTest )
242
+ {
243
+ fbxPrefabUtility . SyncPrefab ( ) ;
244
+ }
245
+ else
246
+ {
247
+ ManualUpdateEditorWindow window = ( ManualUpdateEditorWindow ) EditorWindow . GetWindow ( typeof ( ManualUpdateEditorWindow ) ) ;
248
+ window . Init ( fbxPrefabUtility , fbxPrefabComponent ) ;
249
+ window . Show ( ) ;
250
+ }
251
+
243
252
}
244
253
}
245
254
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ namespace FbxExporters.UnitTests
9
9
{
10
10
public abstract class ExporterTestBase
11
11
{
12
+ bool isAutoUpdaterOn ;
12
13
/// <summary>
13
14
/// Sleep an amount of time (in ms) so we can safely assume that the
14
15
/// timestamp on an fbx will change.
@@ -202,6 +203,20 @@ public virtual void Term ()
202
203
EditorApplication . update += DeleteOnNextUpdate ;
203
204
}
204
205
206
+ [ SetUp ]
207
+ public virtual void InitializeAutoUpdater ( )
208
+ {
209
+ isAutoUpdaterOn = FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled ;
210
+ FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled = true ;
211
+ }
212
+
213
+ [ TearDown ]
214
+ public virtual void ResetAutoUpdater ( )
215
+ {
216
+ // Put back the initial setting for the auto-updater toggle
217
+ FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled = isAutoUpdaterOn ;
218
+ }
219
+
205
220
/// <summary>
206
221
/// Exports the Objects in selected.
207
222
/// </summary>
Original file line number Diff line number Diff line change @@ -175,14 +175,6 @@ public void TestNameMapping()
175
175
176
176
public class FbxPrefabAutoUpdaterRemappingTest : ExporterTestBase
177
177
{
178
- bool isAutoUpdaterOn ;
179
- [ SetUp ]
180
- public void Init ( )
181
- {
182
- isAutoUpdaterOn = FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled ;
183
- FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled = true ;
184
- }
185
-
186
178
[ Test ]
187
179
public void RemappingTest ( )
188
180
{
@@ -228,11 +220,6 @@ public void RemappingTest()
228
220
Assert . IsTrue ( cubePrefabInstance . transform . GetChild ( 0 ) . name == "SphereFBX" ) ;
229
221
Assert . IsTrue ( cubePrefabInstance . transform . GetChild ( 0 ) . GetComponent < MeshFilter > ( ) . sharedMesh != null ) ;
230
222
}
231
- [ TearDown ]
232
- public void stopTest ( )
233
- {
234
- FbxExporters . EditorTools . ExportSettings . instance . autoUpdaterEnabled = isAutoUpdaterOn ;
235
- }
236
223
}
237
224
238
225
public class FbxPrefabAutoUpdaterToggleTest : ExporterTestBase
You can’t perform that action at this time.
0 commit comments