Skip to content

Commit 01c337e

Browse files
authored
Merge pull request #81 from Unity-Technologies/Uni-23171-parent-under-turntable
Uni-23171 parent model-for-review under turntable, if found
2 parents e442828 + ef82d2b commit 01c337e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Assets/FbxExporters/Editor/ReviewLastSavedModel.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,24 @@ private static void UnloadModel (Object model)
7070

7171
private static Object LoadModel (string fbxFileName)
7272
{
73-
Object model = null;
73+
GameObject modelGO = null;
7474

7575
// make relative to UnityProject folder.
7676
string relFileName = System.IO.Path.Combine ("Assets", FbxExporters.EditorTools.ExportSettings.ConvertToAssetRelativePath (fbxFileName));
7777

7878
Object unityMainAsset = UnityEditor.AssetDatabase.LoadMainAssetAtPath (relFileName);
7979

8080
if (unityMainAsset) {
81-
model = UnityEditor.PrefabUtility.InstantiatePrefab (unityMainAsset);
81+
modelGO = UnityEditor.PrefabUtility.InstantiatePrefab (unityMainAsset) as GameObject;
82+
83+
GameObject turntableGO = GameObject.Find ("TurnTable");
84+
if (turntableGO!=null)
85+
{
86+
modelGO.transform.parent = turntableGO.transform;
87+
}
8288
}
8389

84-
return model;
90+
return modelGO as Object;
8591
}
8692

8793
private static void LoadLastSavedModel ()

0 commit comments

Comments
 (0)