Skip to content

Commit b3852c7

Browse files
committed
fix up layout
1 parent fd0b60e commit b3852c7

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ExportModelEditorWindow : EditorWindow
1515
private const string WindowTitle = "Export Options";
1616
private const float SelectableLabelMinWidth = 90;
1717
private const float BrowseButtonWidth = 25;
18-
private const float LabelWidth = 144;
18+
private const float LabelWidth = 175;
1919
private const float FieldOffset = 18;
2020
private string m_exportFileName = "";
2121
private ModelExporter.AnimationExportType m_animExportType = ModelExporter.AnimationExportType.all;
@@ -31,14 +31,14 @@ public class ExportModelEditorWindow : EditorWindow
3131
void OnEnable(){
3232
InitializeReceiver ();
3333
showOptions = true;
34+
this.minSize = new Vector2 (SelectableLabelMinWidth + LabelWidth + BrowseButtonWidth, 220);
3435
}
3536

3637
public static void Init (string filename = "", ModelExporter.AnimationExportType exportType = ModelExporter.AnimationExportType.all)
3738
{
3839
ExportModelEditorWindow window = (ExportModelEditorWindow)EditorWindow.GetWindow <ExportModelEditorWindow>(WindowTitle, focus:true);
3940
window.SetFilename (filename);
4041
window.SetAnimationExportType (exportType);
41-
window.minSize = new Vector2 (SelectableLabelMinWidth + LabelWidth + BrowseButtonWidth, 100);
4242
window.Show ();
4343
}
4444

@@ -166,11 +166,11 @@ void OnGUI ()
166166

167167
GUILayout.BeginHorizontal ();
168168
GUILayout.FlexibleSpace ();
169-
if (GUILayout.Button ("Cancel")) {
169+
if (GUILayout.Button ("Cancel", GUILayout.Width(100))) {
170170
this.Close ();
171171
}
172172

173-
if (GUILayout.Button ("Export")) {
173+
if (GUILayout.Button ("Export", GUILayout.Width(100))) {
174174
var filePath = ExportSettings.GetExportModelAbsoluteSavePath ();
175175

176176
filePath = System.IO.Path.Combine (filePath, m_exportFileName);

Assets/FbxExporters/Editor/ExportModelSettings.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,42 @@ namespace FbxExporters.EditorTools
66
[CustomEditor (typeof(ExportModelSettings))]
77
public class ExportModelSettingsEditor : UnityEditor.Editor
88
{
9-
private const float LabelWidth = 144;
9+
private const float LabelWidth = 175;
1010
private const float FieldOffset = 18;
1111

1212
public override void OnInspectorGUI ()
1313
{
1414
var exportSettings = ((ExportModelSettings)target).info;
1515

16+
EditorGUIUtility.labelWidth = LabelWidth;
17+
1618
GUILayout.BeginHorizontal();
17-
EditorGUILayout.LabelField(new GUIContent("Export Format:", "Export the FBX file in the standard binary format." +
19+
EditorGUILayout.LabelField(new GUIContent("Export Format", "Export the FBX file in the standard binary format." +
1820
" Select ASCII to export the FBX file in ASCII format."), GUILayout.Width(LabelWidth - FieldOffset));
1921
exportSettings.exportFormat = (ExportModelSettingsSerialize.ExportFormat)EditorGUILayout.Popup((int)exportSettings.exportFormat, new string[]{ "ASCII", "Binary" });
2022
GUILayout.EndHorizontal();
2123

2224
GUILayout.BeginHorizontal();
23-
EditorGUILayout.LabelField(new GUIContent("Include:", "Select whether to export models, animation or both."), GUILayout.Width(LabelWidth - FieldOffset));
25+
EditorGUILayout.LabelField(new GUIContent("Include", "Select whether to export models, animation or both."), GUILayout.Width(LabelWidth - FieldOffset));
2426
exportSettings.include = (ExportModelSettingsSerialize.Include)EditorGUILayout.Popup((int)exportSettings.include, new string[]{"Model(s) Only", "Animation Only", "Model(s) + Animation"});
2527
GUILayout.EndHorizontal();
2628

2729
GUILayout.BeginHorizontal();
28-
EditorGUILayout.LabelField(new GUIContent("LOD level:", "Select which LOD to export."), GUILayout.Width(LabelWidth - FieldOffset));
30+
EditorGUILayout.LabelField(new GUIContent("LOD level", "Select which LOD to export."), GUILayout.Width(LabelWidth - FieldOffset));
2931
exportSettings.lodLevel = (ExportSettings.LODExportType)EditorGUILayout.Popup((int)exportSettings.lodLevel, new string[]{"All", "Highest", "Lowest"});
3032
GUILayout.EndHorizontal();
3133

3234
GUILayout.BeginHorizontal();
33-
EditorGUILayout.LabelField(new GUIContent("Object(s) Position:", "Select an option for exporting object's transform."), GUILayout.Width(LabelWidth - FieldOffset));
35+
EditorGUILayout.LabelField(new GUIContent("Object(s) Position", "Select an option for exporting object's transform."), GUILayout.Width(LabelWidth - FieldOffset));
3436
exportSettings.objectPosition = (ExportModelSettingsSerialize.ObjectPosition)EditorGUILayout.Popup((int)exportSettings.objectPosition, new string[]{"Local Centered", "World Absolute", "Local Pivot"});
3537
GUILayout.EndHorizontal();
38+
39+
GUILayout.BeginHorizontal();
40+
EditorGUILayout.LabelField(new GUIContent("Transfer Root Motion To", "Select bone to transfer root motion animation to."), GUILayout.Width(LabelWidth - FieldOffset));
41+
EditorGUILayout.Popup(0, new string[]{"<None>"});
42+
GUILayout.EndHorizontal();
43+
44+
exportSettings.animatedSkinnedMesh = EditorGUILayout.Toggle ("Animated Skinned Mesh", exportSettings.animatedSkinnedMesh);
3645
}
3746
}
3847

0 commit comments

Comments
 (0)