Skip to content

Commit 51c98d1

Browse files
committed
clean up to remove duplicate code
1 parent 7d44984 commit 51c98d1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Assets/FbxExporters/Editor/ConvertToPrefabEditorWindow.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ protected override bool DisableNameSelection ()
8484

8585
protected override void ShowPresetReceiver ()
8686
{
87-
InitializeReceiver ();
88-
m_receiver.SetTarget(ExportSettings.instance.convertToPrefabSettings);
89-
m_receiver.SetInitialValue (new Preset (ExportSettings.instance.convertToPrefabSettings));
90-
UnityEditor.Presets.PresetSelector.ShowSelector(ExportSettings.instance.convertToPrefabSettings, null, true, m_receiver);
87+
ShowPresetReceiver (ExportSettings.instance.convertToPrefabSettings);
9188
}
9289

9390
protected override void CreateCustomUI ()

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ protected virtual bool DisableNameSelection(){
130130

131131
protected abstract void ShowPresetReceiver ();
132132

133+
protected void ShowPresetReceiver(UnityEngine.Object target){
134+
InitializeReceiver ();
135+
m_receiver.SetTarget(target);
136+
m_receiver.SetInitialValue (new Preset (target));
137+
UnityEditor.Presets.PresetSelector.ShowSelector(target, null, true, m_receiver);
138+
}
139+
133140
protected void OnGUI ()
134141
{
135142
// Increasing the label width so that none of the text gets cut off
@@ -301,10 +308,7 @@ protected override void Export(){
301308

302309
protected override void ShowPresetReceiver ()
303310
{
304-
InitializeReceiver ();
305-
m_receiver.SetTarget(ExportSettings.instance.exportModelSettings);
306-
m_receiver.SetInitialValue (new Preset (ExportSettings.instance.exportModelSettings));
307-
UnityEditor.Presets.PresetSelector.ShowSelector(ExportSettings.instance.exportModelSettings, null, true, m_receiver);
311+
ShowPresetReceiver (ExportSettings.instance.exportModelSettings);
308312
}
309313
}
310314
}

0 commit comments

Comments
 (0)