Skip to content

Commit 692ba61

Browse files
author
David Lassonde
committed
Updating the Windows native dll
Updating meta files Updating auto-converted script
1 parent d235be8 commit 692ba61

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

Assets/com.unity.formats.fbx.tests/ConvertToModelTest.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ public void TestStaticHelpers()
9393
var aFbx = ConvertToModel.GetOrCreateFbxAsset(a, fbxFullPath: GetRandomFbxFilePath());
9494
var bFbx = ConvertToModel.GetOrCreateInstance(aFbx);
9595
Assert.AreNotEqual(aFbx, bFbx);
96-
Assert.AreEqual(aFbx, PrefabUtility.GetPrefabParent(bFbx));
96+
Assert.AreEqual(aFbx, PrefabUtility.GetCorrespondingObjectFromSource(bFbx));
9797

9898
// Test on an prefab asset
9999
var aPrefab = PrefabUtility.CreatePrefab(GetRandomPrefabAssetPath(), a);
100100
var bPrefab = ConvertToModel.GetOrCreateInstance(aPrefab);
101101
Assert.AreNotEqual(aPrefab, bPrefab);
102-
Assert.AreEqual(aPrefab, PrefabUtility.GetPrefabParent(bPrefab));
102+
Assert.AreEqual(aPrefab, PrefabUtility.GetCorrespondingObjectFromSource(bPrefab));
103103
}
104104

105105
// Test SetupFbxPrefab
@@ -122,13 +122,13 @@ public void TestStaticHelpers()
122122

123123
var aPath = GetRandomPrefabAssetPath();
124124
var aPrefab = ConvertToModel.ApplyOrCreatePrefab(a, prefabFullPath: aPath);
125-
Assert.AreEqual(aPrefab, PrefabUtility.GetPrefabParent(a));
125+
Assert.AreEqual(aPrefab, PrefabUtility.GetCorrespondingObjectFromSource(a));
126126

127127
// Now apply it again (replacing aPrefab). Make sure we use the
128128
// same file rather than creating a new one.
129129
var bPath = GetRandomPrefabAssetPath();
130130
var bPrefab = ConvertToModel.ApplyOrCreatePrefab(a, prefabFullPath: bPath);
131-
Assert.AreEqual(bPrefab, PrefabUtility.GetPrefabParent(a));
131+
Assert.AreEqual(bPrefab, PrefabUtility.GetCorrespondingObjectFromSource(a));
132132
Assert.AreEqual(aPath, AssetDatabase.GetAssetPath(bPrefab));
133133
}
134134

@@ -227,7 +227,7 @@ public void BasicTest()
227227
Assert.That(cube); // we kept the original
228228
Assert.That(cubePrefab); // we got the new
229229
Assert.AreEqual("Cube", cubePrefab.name); // it has the right name
230-
Assert.AreSame(PrefabUtility.GetPrefabParent(cube), cubePrefab); // the original and new are the same
230+
Assert.AreSame(PrefabUtility.GetCorrespondingObjectFromSource(cube), cubePrefab); // the original and new are the same
231231
Assert.That(!EditorUtility.IsPersistent(cube));
232232
Assert.That(EditorUtility.IsPersistent(cubePrefab));
233233

@@ -265,7 +265,7 @@ public void ExhaustiveTests() {
265265
{
266266
var a = CreateHierarchy();
267267
var aConvert = ConvertToModel.Convert(a, fbxFullPath: GetRandomFbxFilePath(), prefabFullPath: GetRandomPrefabAssetPath());
268-
Assert.AreEqual(aConvert, PrefabUtility.GetPrefabParent(a));
268+
Assert.AreEqual(aConvert, PrefabUtility.GetCorrespondingObjectFromSource(a));
269269
}
270270

271271
// Test Convert on a prefab asset.
@@ -295,7 +295,7 @@ public void ExhaustiveTests() {
295295
var aPrefab = PrefabUtility.CreatePrefab(aPrefabPath, a);
296296
var bPrefabPath = GetRandomPrefabAssetPath();
297297
var aConvert = ConvertToModel.Convert(a, fbxFullPath: GetRandomFbxFilePath(), prefabFullPath: bPrefabPath);
298-
Assert.AreEqual(aConvert, PrefabUtility.GetPrefabParent(a));
298+
Assert.AreEqual(aConvert, PrefabUtility.GetCorrespondingObjectFromSource(a));
299299
Assert.AreEqual(bPrefabPath, AssetDatabase.GetAssetPath(aConvert));
300300
Assert.AreEqual(aPrefabPath, AssetDatabase.GetAssetPath(aPrefab));
301301
Assert.AreNotEqual(aPrefabPath, AssetDatabase.GetAssetPath(aConvert));
@@ -437,7 +437,7 @@ public void TestInstanceNameMatchesFilename()
437437

438438
Assert.That (cube);
439439
Assert.That (cubePrefab);
440-
Assert.AreSame (cubePrefab, PrefabUtility.GetPrefabParent(cube));
440+
Assert.AreSame (cubePrefab, PrefabUtility.GetCorrespondingObjectFromSource(cube));
441441

442442
Assert.AreEqual (Path.GetFileNameWithoutExtension (path), cube.name);
443443
}
@@ -476,7 +476,7 @@ public void TestConvertModelInstance()
476476
GameObject converted = ConvertToModel.Convert (fbxInstance,
477477
fbxFullPath: GetRandomFbxFilePath(),
478478
prefabFullPath: GetRandomPrefabAssetPath());
479-
Assert.That (converted, Is.EqualTo (PrefabUtility.GetPrefabParent(fbxInstance)));
479+
Assert.That (converted, Is.EqualTo (PrefabUtility.GetCorrespondingObjectFromSource(fbxInstance)));
480480

481481
// check meshes link to original fbx
482482
var prefabCubeMesh = fbxInstance.GetComponent<MeshFilter>().sharedMesh;

Packages/com.unity.formats.fbx/Editor.meta

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.unity.formats.fbx/Editor/Integrations.meta

Lines changed: 0 additions & 10 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)