File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1265,6 +1265,9 @@ private void ReplaceFile ()
1265
1265
} catch ( IOException ) {
1266
1266
}
1267
1267
1268
+ // refresh the database so Unity knows the file's been deleted
1269
+ AssetDatabase . Refresh ( ) ;
1270
+
1268
1271
if ( File . Exists ( m_lastFilePath ) ) {
1269
1272
Debug . LogWarning ( "Failed to delete file: " + m_lastFilePath ) ;
1270
1273
}
Original file line number Diff line number Diff line change @@ -425,10 +425,16 @@ public void TestTransformAndReparenting()
425
425
var newCopyPath = ModelExporter . ExportObject (
426
426
GetRandomFbxFilePath ( ) , root ) ;
427
427
SleepForFileTimestamp ( ) ;
428
+
429
+ var destFile = new FbxPrefabAutoUpdater . FbxPrefabUtility ( original . GetComponent < FbxPrefab > ( ) ) . GetFbxAssetPath ( ) ;
430
+ if ( System . IO . File . Exists ( destFile ) ) {
431
+ System . IO . File . Delete ( destFile ) ;
432
+ }
433
+ AssetDatabase . Refresh ( ) ;
428
434
System . IO . File . Copy (
429
435
newCopyPath ,
430
- new FbxPrefabAutoUpdater . FbxPrefabUtility ( original . GetComponent < FbxPrefab > ( ) ) . GetFbxAssetPath ( ) ,
431
- overwrite : true ) ;
436
+ destFile ,
437
+ overwrite : false ) ;
432
438
AssetDatabase . Refresh ( ) ;
433
439
434
440
// Make sure the update took.
You can’t perform that action at this time.
0 commit comments