Skip to content

Commit e09a02e

Browse files
committed
add export options to preset
1 parent d6eabb8 commit e09a02e

File tree

1 file changed

+39
-16
lines changed

1 file changed

+39
-16
lines changed
Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
11
using UnityEditor;
22
using UnityEngine;
33

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;
611

7-
public override void OnInspectorGUI() {
8-
var exportSettings = (ExportModelSettings)target;
12+
public override void OnInspectorGUI ()
13+
{
14+
var exportSettings = ((ExportModelSettings)target).info;
915

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+
}
1124
}
12-
}
1325

14-
public class ExportModelSettings : ScriptableObject {
15-
public ExportModelSettingsSerialize info;
26+
public class ExportModelSettings : ScriptableObject
27+
{
28+
public ExportModelSettingsSerialize info;
1629

17-
public ExportModelSettings(){
18-
info = new ExportModelSettingsSerialize ();
30+
public ExportModelSettings ()
31+
{
32+
info = new ExportModelSettingsSerialize ();
33+
}
1934
}
20-
}
2135

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 }
2544

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;
2851
}
2952
}

0 commit comments

Comments
 (0)