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 @@ -1318,6 +1318,9 @@ private void ReplaceFile ()
1318
1318
} catch ( IOException ) {
1319
1319
}
1320
1320
1321
+ // refresh the database so Unity knows the file's been deleted
1322
+ AssetDatabase . Refresh ( ) ;
1323
+
1321
1324
if ( File . Exists ( m_lastFilePath ) ) {
1322
1325
Debug . LogWarning ( "Failed to delete file: " + m_lastFilePath ) ;
1323
1326
}
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