File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Assets/FbxExporters/Editor/UnitTests Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -233,5 +233,28 @@ public void MapNameToSourceTest()
233
233
Assert . AreSame ( capsule3 , dictionaryBroken [ capsule . name ] ) ;
234
234
Assert . AreSame ( sphere3 , dictionaryBroken [ sphere . name ] ) ;
235
235
}
236
+
237
+ [ Test ]
238
+ public void TestInstanceNameMatchesFilename ( )
239
+ {
240
+ // create a cube, export it to random filename
241
+ // make sure instance name gets updated when converting to prefab
242
+
243
+ // Get a random directory.
244
+ var path = GetRandomFileNamePath ( extName : ".fbx" ) ;
245
+
246
+ // Create a cube.
247
+ var cube = GameObject . CreatePrimitive ( PrimitiveType . Cube ) ;
248
+
249
+ // Convert it to a prefab -- but keep the cube.
250
+ var cubePrefabInstance = ConvertToModel . Convert ( cube ,
251
+ fbxFullPath : path ) ;
252
+
253
+ Assert . That ( cube ) ;
254
+ Assert . That ( cubePrefabInstance ) ;
255
+ Assert . AreSame ( cube , cubePrefabInstance ) ;
256
+
257
+ Assert . AreEqual ( Path . GetFileNameWithoutExtension ( path ) , cube . name ) ;
258
+ }
236
259
}
237
260
}
You can’t perform that action at this time.
0 commit comments