@@ -195,7 +195,7 @@ public void MapNameToSourceTest()
195
195
capsule . transform . parent = cube . transform ;
196
196
sphere . transform . parent = cube . transform ;
197
197
quad . transform . parent = cube . transform ;
198
-
198
+ capsule . transform . SetSiblingIndex ( 0 ) ;
199
199
200
200
//Create a similar Heirarchy that we can use as our phony "exported" hierarchy.
201
201
var cube2 = GameObject . CreatePrimitive ( PrimitiveType . Cube ) ;
@@ -206,9 +206,16 @@ public void MapNameToSourceTest()
206
206
capsule2 . transform . parent = cube2 . transform ;
207
207
sphere2 . transform . parent = cube2 . transform ;
208
208
quad2 . transform . parent = cube2 . transform ;
209
+ capsule . transform . SetSiblingIndex ( 1 ) ;
209
210
210
211
var dictionary = ConvertToModel . MapNameToSourceRecursive ( cube , cube2 ) ;
211
212
213
+ //We expect these to pass because we've given it an identical game object, as it would have after a normal export.
214
+ Assert . AreSame ( capsule2 , dictionary [ capsule . name ] ) ;
215
+ Assert . AreSame ( sphere2 , dictionary [ sphere . name ] ) ;
216
+ Assert . AreSame ( quad2 , dictionary [ quad . name ] ) ;
217
+ Assert . True ( dictionary . Count == 4 ) ;
218
+
212
219
//Create a broken hierarchy, one that is missing a primitive
213
220
var cube3 = GameObject . CreatePrimitive ( PrimitiveType . Cube ) ;
214
221
var capsule3 = GameObject . CreatePrimitive ( PrimitiveType . Capsule ) ;
@@ -219,11 +226,6 @@ public void MapNameToSourceTest()
219
226
220
227
var dictionaryBroken = ConvertToModel . MapNameToSourceRecursive ( cube , cube3 ) ;
221
228
222
- //We expect these to pass because we've given it an identical game object, as it would have after a normal export.
223
- Assert . AreSame ( capsule2 , dictionary [ capsule . name ] ) ;
224
- Assert . AreSame ( sphere2 , dictionary [ sphere . name ] ) ;
225
- Assert . AreSame ( quad2 , dictionary [ quad . name ] ) ;
226
-
227
229
//the dictionary size should be equal to the amount of children + the parent
228
230
Assert . True ( dictionaryBroken . Count == 4 ) ;
229
231
0 commit comments