5
5
using System . IO ;
6
6
using System . Collections . Generic ;
7
7
using Unity . FbxSdk ;
8
+ using FbxExporters . EditorTools ;
8
9
9
10
namespace FbxExporters . UnitTests
10
11
{
@@ -16,13 +17,13 @@ namespace FbxExporters.UnitTests
16
17
public class DefaultSelectionTest : ExporterTestBase
17
18
{
18
19
protected GameObject m_root ;
19
- protected bool m_centerObjectsSetting ;
20
+ protected ExportModelSettingsSerialize . ObjectPosition m_centerObjectsSetting ;
20
21
21
22
[ SetUp ]
22
23
public override void Init ( )
23
24
{
24
25
base . Init ( ) ;
25
- m_centerObjectsSetting = FbxExporters . EditorTools . ExportSettings . instance . centerObjects ;
26
+ m_centerObjectsSetting = FbxExporters . EditorTools . ExportSettings . GetObjectPosition ( ) ;
26
27
}
27
28
28
29
[ TearDown ]
@@ -33,7 +34,7 @@ public override void Term ()
33
34
UnityEngine . Object . DestroyImmediate ( m_root ) ;
34
35
}
35
36
// restore original setting
36
- FbxExporters . EditorTools . ExportSettings . instance . centerObjects = m_centerObjectsSetting ;
37
+ FbxExporters . EditorTools . ExportSettings . SetObjectPosition ( m_centerObjectsSetting ) ;
37
38
}
38
39
39
40
[ Test ]
@@ -62,7 +63,7 @@ public void TestDefaultSelection ()
62
63
Assert . IsNotNull ( m_root ) ;
63
64
64
65
// test without centered objects
65
- FbxExporters . EditorTools . ExportSettings . instance . centerObjects = false ;
66
+ FbxExporters . EditorTools . ExportSettings . SetObjectPosition ( ExportModelSettingsSerialize . ObjectPosition . WorldAbsolute ) ;
66
67
67
68
// test Export Root
68
69
// Expected result: everything gets exported
@@ -97,7 +98,7 @@ public void TestDefaultSelection ()
97
98
var goExportSet = new GameObject [ ] { child2 . gameObject , parent2 . gameObject } ;
98
99
99
100
// test without centering objects
100
- FbxExporters . EditorTools . ExportSettings . instance . centerObjects = false ;
101
+ FbxExporters . EditorTools . ExportSettings . SetObjectPosition ( ExportModelSettingsSerialize . ObjectPosition . WorldAbsolute ) ;
101
102
102
103
exportedRoot = ExportSelection ( exportSet ) ;
103
104
List < GameObject > children = new List < GameObject > ( ) ;
@@ -107,7 +108,7 @@ public void TestDefaultSelection ()
107
108
CompareHierarchies ( new GameObject [ ] { child2 , parent2 . gameObject } , children . ToArray ( ) ) ;
108
109
109
110
// test with centered objects
110
- FbxExporters . EditorTools . ExportSettings . instance . centerObjects = true ;
111
+ FbxExporters . EditorTools . ExportSettings . SetObjectPosition ( ExportModelSettingsSerialize . ObjectPosition . LocalCentered ) ;
111
112
var newCenter = FbxExporters . Editor . ModelExporter . FindCenter ( goExportSet ) ;
112
113
113
114
exportedRoot = ExportSelection ( exportSet ) ;
0 commit comments