File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Assets/FbxExporters/Editor Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -70,18 +70,24 @@ private static void UnloadModel (Object model)
70
70
71
71
private static Object LoadModel ( string fbxFileName )
72
72
{
73
- Object model = null ;
73
+ GameObject modelGO = null ;
74
74
75
75
// make relative to UnityProject folder.
76
76
string relFileName = System . IO . Path . Combine ( "Assets" , FbxExporters . EditorTools . ExportSettings . ConvertToAssetRelativePath ( fbxFileName ) ) ;
77
77
78
78
Object unityMainAsset = UnityEditor . AssetDatabase . LoadMainAssetAtPath ( relFileName ) ;
79
79
80
80
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
+ }
82
88
}
83
89
84
- return model ;
90
+ return modelGO as Object ;
85
91
}
86
92
87
93
private static void LoadLastSavedModel ( )
You can’t perform that action at this time.
0 commit comments