Skip to content

Commit 5b14812

Browse files
author
Benoit Hudson
committed
uni-24386 Test transform changes.
1 parent bb07034 commit 5b14812

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Assets/FbxExporters/Editor/UnitTests/FbxPrefabTest.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ GameObject ModifySourceFbx()
193193
{
194194
// Generate this change:
195195
// - delete parent1
196+
// - move parent2
196197
// - add parent3
197198
// Simulate that we're doing this in Maya, so parent3 doesn't come
198199
// with a collider.
@@ -201,6 +202,9 @@ GameObject ModifySourceFbx()
201202
var parent3 = CreateGameObject("Parent3", newModel.transform);
202203
Object.DestroyImmediate(parent3.GetComponent<BoxCollider>());
203204

205+
var parent2 = newModel.transform.Find("Parent2");
206+
parent2.localPosition += new Vector3(1,2,3);
207+
204208
// Export it to clobber the old FBX file.
205209
// Sleep one second first to make sure the timestamp differs
206210
// enough, so the asset database knows to reload it. I was getting
@@ -240,11 +244,10 @@ public void BasicTest() {
240244
AssertAreIdentical(m_originalRep, Rep(m_manualPrefab));
241245
AssertAreIdentical(m_originalHistory, History(m_manualPrefab));
242246

243-
// Make sure we got the right changes.
247+
// Make sure we got the right changes. Parent2 got its
248+
// transform changed, Parent3 was created.
244249
Assert.AreEqual (1, updateSet.NumUpdates);
245250
Assert.That (updateSet.Updated, Is.EquivalentTo (new string [] {
246-
// TODO: UNI-24579 - we should only be seeing Parent3 here.
247-
// Parent2 is for a transform change, but it shouldn't have changed.
248251
"Parent2", "Parent3"
249252
}
250253
));
@@ -297,7 +300,7 @@ public void BasicTest() {
297300

298301
// Generate the answer we expect: the original but Parent1 and
299302
// hierarchy are without collider. That's because we deleted them,
300-
// and got them back.
303+
// and got them back. Parent2 should be back to the origin.
301304
var expectedHierarchy = GameObject.Instantiate(m_original);
302305
var parent1 = expectedHierarchy.transform.Find("Parent1");
303306
foreach(var collider in parent1.GetComponentsInChildren<BoxCollider>()) {

0 commit comments

Comments
 (0)