3
3
using UnityEngine ;
4
4
using UnityEditor ;
5
5
using FbxExporters . EditorTools ;
6
- using UnityEditor . Presets ;
7
6
using System . Linq ;
8
7
9
8
namespace FbxExporters
@@ -29,10 +28,6 @@ public abstract class ExportOptionsEditorWindow : EditorWindow
29
28
protected string m_exportFileName = "" ;
30
29
31
30
protected UnityEditor . Editor m_innerEditor ;
32
- protected FbxExportPresetSelectorReceiver m_receiver ;
33
-
34
- private static GUIContent presetIcon { get { return EditorGUIUtility . IconContent ( "Preset.Context" ) ; } }
35
- private static GUIStyle presetIconButton { get { return new GUIStyle ( "IconButton" ) ; } }
36
31
37
32
private bool m_showOptions ;
38
33
@@ -41,7 +36,6 @@ public abstract class ExportOptionsEditorWindow : EditorWindow
41
36
protected float m_fbxExtLabelWidth ;
42
37
43
38
protected virtual void OnEnable ( ) {
44
- InitializeReceiver ( ) ;
45
39
m_showOptions = true ;
46
40
this . minSize = new Vector2 ( SelectableLabelMinWidth + LabelWidth + BrowseButtonWidth , MinWindowHeight ) ;
47
41
@@ -66,16 +60,6 @@ protected virtual void InitializeWindow(string filename = ""){
66
60
this . SetFilename ( filename ) ;
67
61
}
68
62
69
- protected void InitializeReceiver ( ) {
70
- if ( ! m_receiver ) {
71
- m_receiver = ScriptableObject . CreateInstance < FbxExportPresetSelectorReceiver > ( ) as FbxExportPresetSelectorReceiver ;
72
- m_receiver . SelectionChanged -= OnPresetSelectionChanged ;
73
- m_receiver . SelectionChanged += OnPresetSelectionChanged ;
74
- m_receiver . DialogClosed -= SaveExportSettings ;
75
- m_receiver . DialogClosed += SaveExportSettings ;
76
- }
77
- }
78
-
79
63
public void SetFilename ( string filename ) {
80
64
// remove .fbx from end of filename
81
65
int extIndex = filename . LastIndexOf ( ".fbx" ) ;
@@ -109,25 +93,13 @@ protected virtual bool DisableNameSelection(){
109
93
return false ;
110
94
}
111
95
112
- protected abstract void ShowPresetReceiver ( ) ;
113
-
114
- protected void ShowPresetReceiver ( UnityEngine . Object target ) {
115
- InitializeReceiver ( ) ;
116
- m_receiver . SetTarget ( target ) ;
117
- m_receiver . SetInitialValue ( new Preset ( target ) ) ;
118
- UnityEditor . Presets . PresetSelector . ShowSelector ( target , null , true , m_receiver ) ;
119
- }
120
-
121
96
protected void OnGUI ( )
122
97
{
123
98
// Increasing the label width so that none of the text gets cut off
124
99
EditorGUIUtility . labelWidth = LabelWidth ;
125
100
126
101
GUILayout . BeginHorizontal ( ) ;
127
102
GUILayout . FlexibleSpace ( ) ;
128
- if ( EditorGUILayout . DropdownButton ( presetIcon , FocusType . Keyboard , presetIconButton ) ) {
129
- ShowPresetReceiver ( ) ;
130
- }
131
103
GUILayout . EndHorizontal ( ) ;
132
104
133
105
EditorGUILayout . LabelField ( "Naming" ) ;
@@ -362,11 +334,6 @@ protected override void Export(){
362
334
AssetDatabase . Refresh ( ) ;
363
335
}
364
336
}
365
-
366
- protected override void ShowPresetReceiver ( )
367
- {
368
- ShowPresetReceiver ( ExportSettings . instance . exportModelSettings ) ;
369
- }
370
337
}
371
338
}
372
339
}
0 commit comments