1
1
using UnityEditor ;
2
2
using UnityEngine ;
3
3
4
- [ CustomEditor ( typeof ( ExportModelSettings ) ) ]
5
- public class ExportModelSettingsEditor : UnityEditor . Editor {
4
+ namespace FbxExporters . EditorTools
5
+ {
6
+ [ CustomEditor ( typeof ( ExportModelSettings ) ) ]
7
+ public class ExportModelSettingsEditor : UnityEditor . Editor
8
+ {
9
+ private const float LabelWidth = 144 ;
10
+ private const float FieldOffset = 18 ;
6
11
7
- public override void OnInspectorGUI ( ) {
8
- var exportSettings = ( ExportModelSettings ) target ;
12
+ public override void OnInspectorGUI ( )
13
+ {
14
+ var exportSettings = ( ( ExportModelSettings ) target ) . info ;
9
15
10
- exportSettings . info . test = EditorGUILayout . TextField ( exportSettings . info . test ) ;
16
+ //exportSettings.info.test = EditorGUILayout.TextField (exportSettings.info.test);
17
+
18
+ GUILayout . BeginHorizontal ( ) ;
19
+ EditorGUILayout . LabelField ( new GUIContent ( "Export Format:" , "Export the FBX file in the standard binary format." +
20
+ " Select ASCII to export the FBX file in ASCII format." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
21
+ exportSettings . exportFormat = ( ExportModelSettingsSerialize . ExportFormat ) EditorGUILayout . Popup ( ( int ) exportSettings . exportFormat , new string [ ] { "ASCII" , "Binary" } ) ;
22
+ GUILayout . EndHorizontal ( ) ;
23
+ }
11
24
}
12
- }
13
25
14
- public class ExportModelSettings : ScriptableObject {
15
- public ExportModelSettingsSerialize info ;
26
+ public class ExportModelSettings : ScriptableObject
27
+ {
28
+ public ExportModelSettingsSerialize info ;
16
29
17
- public ExportModelSettings ( ) {
18
- info = new ExportModelSettingsSerialize ( ) ;
30
+ public ExportModelSettings ( )
31
+ {
32
+ info = new ExportModelSettingsSerialize ( ) ;
33
+ }
19
34
}
20
- }
21
35
22
- [ System . Serializable ]
23
- public class ExportModelSettingsSerialize {
24
- public string test = "hi" ;
36
+ [ System . Serializable ]
37
+ public class ExportModelSettingsSerialize
38
+ {
39
+ public enum ExportFormat { ASCII = 0 , Binary = 1 }
40
+
41
+ public enum Include { Model = 0 , Anim = 1 , ModelAndAnim = 2 }
42
+
43
+ public enum ObjectPosition { LocalCentered = 0 , WorldAbsolute = 1 , LocalPivot = 2 }
25
44
26
- public ExportModelSettingsSerialize ( ) {
27
- test = "hello" ;
45
+ public ExportFormat exportFormat = ExportFormat . ASCII ;
46
+ public Include include = Include . ModelAndAnim ;
47
+ public ExportSettings . LODExportType lodLevel = ExportSettings . LODExportType . All ;
48
+ public ObjectPosition objectPosition = ObjectPosition . LocalCentered ;
49
+ public string rootMotionTransfer = "" ;
50
+ public bool animatedSkinnedMesh = true ;
28
51
}
29
52
}
0 commit comments