Skip to content

Commit 5f3981a

Browse files
committed
added parent: true, child: false test
1 parent de0da22 commit 5f3981a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Assets/FbxExporters/Editor/UnitTests/ModelExporterTest.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ public void TestNodeVisibility()
323323
// create test hierarchy
324324
// root (enabled)
325325
// -- parent1 (enabled)
326+
// ---- child3 (disabled)
326327
// -- parent2 (disabled)
327328
// ---- child1 (disabled)
328329
// ---- child2 (enabled)
@@ -337,17 +338,21 @@ public void TestNodeVisibility()
337338
child1.name = "child1";
338339
var child2 = GameObject.CreatePrimitive(PrimitiveType.Cube);
339340
child2.name = "child2";
341+
var child3 = GameObject.CreatePrimitive (PrimitiveType.Cube);
342+
child3.name = "child3";
340343

341344
parent1.transform.SetParent (root.transform);
342345
parent2.transform.SetParent (root.transform);
343346
child1.transform.SetParent (parent2.transform);
344347
child2.transform.SetParent (parent2.transform);
348+
child3.transform.SetParent (parent1.transform);
345349

346350
root.SetActive (true);
347351
parent1.SetActive (true);
348352
child2.SetActive (true);
349353
parent2.SetActive (false);
350354
child1.SetActive (false);
355+
child3.SetActive (false);
351356

352357
string filename = GetRandomFbxFilePath ();
353358
ModelExporter.ExportObject (filename, root);
@@ -362,11 +367,9 @@ public void TestNodeVisibility()
362367
var isParent1 = child.name.Equals ("parent1");
363368
CheckObjectVisibility (child.gameObject, isParent1);
364369

365-
if (isParent1) {
366-
// all of parent1's children should be disabled
367-
foreach (Transform c in child) {
368-
CheckObjectVisibility (c.gameObject, false);
369-
}
370+
// all children should be disabled
371+
foreach (Transform c in child) {
372+
CheckObjectVisibility (c.gameObject, false);
370373
}
371374
}
372375
}

0 commit comments

Comments
 (0)