File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,12 @@ public static GameObject Convert (
173
173
SetupImportedGameObject ( toConvert , unityGO ) ;
174
174
175
175
// Set up the FbxPrefab component so it will auto-update.
176
- var fbxPrefab = unityGO . AddComponent < FbxPrefab > ( ) ;
176
+ // Make sure to delete whatever FbxPrefab history we had.
177
+ var fbxPrefab = unityGO . GetComponent < FbxPrefab > ( ) ;
178
+ if ( fbxPrefab ) {
179
+ Object . DestroyImmediate ( fbxPrefab ) ;
180
+ }
181
+ fbxPrefab = unityGO . AddComponent < FbxPrefab > ( ) ;
177
182
fbxPrefab . SetSourceModel ( unityMainAsset ) ;
178
183
179
184
// Disconnect from the FBX file.
Original file line number Diff line number Diff line change @@ -165,6 +165,11 @@ public void BasicTest()
165
165
var assetFullPath = Path . GetFullPath ( Path . Combine ( Application . dataPath ,
166
166
"../" + assetRelativePath ) ) ;
167
167
Assert . AreEqual ( Path . GetFullPath ( path ) , Path . GetDirectoryName ( assetFullPath ) ) ;
168
+
169
+ // Convert it again, make sure there's only one FbxPrefab (see UNI-25528).
170
+ var cubePrefabInstance2 = ConvertToModel . Convert ( cubePrefabInstance ,
171
+ directoryFullPath : path , keepOriginal : false ) ;
172
+ Assert . That ( cubePrefabInstance2 . GetComponents < FbxPrefab > ( ) . Length , Is . EqualTo ( 1 ) ) ;
168
173
}
169
174
}
170
175
}
You can’t perform that action at this time.
0 commit comments