Skip to content

Commit 9a49eaf

Browse files
authored
Merge pull request #340 from Unity-Technologies/Uni-41549-RemovePresetForUnity2017
Uni-41549-RemovePresetForUnity2017
2 parents 9271efb + 976ce8e commit 9a49eaf

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

Assets/FbxExporters/Editor/ConvertToPrefabEditorWindow.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
using UnityEngine;
44
using UnityEditor;
55
using FbxExporters.EditorTools;
6+
#if UNITY_2018_1_OR_NEWER
67
using UnityEditor.Presets;
8+
#endif
79
using System.Linq;
810

911
namespace FbxExporters
@@ -84,12 +86,12 @@ protected override bool DisableNameSelection ()
8486
{
8587
return m_toConvert.Length > 1;
8688
}
87-
89+
#if UNITY_2018_1_OR_NEWER
8890
protected override void ShowPresetReceiver ()
8991
{
9092
ShowPresetReceiver (ExportSettings.instance.convertToPrefabSettings);
9193
}
92-
94+
#endif
9395
protected override void CreateCustomUI ()
9496
{
9597
GUILayout.BeginHorizontal ();

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
using UnityEngine;
44
using UnityEditor;
55
using FbxExporters.EditorTools;
6+
#if UNITY_2018_1_OR_NEWER
67
using UnityEditor.Presets;
8+
#endif
79
using System.Linq;
810

911
namespace FbxExporters
@@ -29,8 +31,9 @@ public abstract class ExportOptionsEditorWindow : EditorWindow
2931
protected string m_exportFileName = "";
3032

3133
protected UnityEditor.Editor m_innerEditor;
34+
#if UNITY_2018_1_OR_NEWER
3235
protected FbxExportPresetSelectorReceiver m_receiver;
33-
36+
#endif
3437
private static GUIContent presetIcon { get { return EditorGUIUtility.IconContent ("Preset.Context"); }}
3538
private static GUIStyle presetIconButton { get { return new GUIStyle("IconButton"); }}
3639

@@ -41,8 +44,9 @@ public abstract class ExportOptionsEditorWindow : EditorWindow
4144
protected float m_fbxExtLabelWidth;
4245

4346
protected virtual void OnEnable(){
47+
#if UNITY_2018_1_OR_NEWER
4448
InitializeReceiver ();
45-
49+
#endif
4650
m_showOptions = true;
4751
this.minSize = new Vector2 (SelectableLabelMinWidth + LabelWidth + BrowseButtonWidth, MinWindowHeight);
4852

@@ -67,6 +71,7 @@ protected virtual void InitializeWindow(string filename = ""){
6771
this.SetFilename (filename);
6872
}
6973

74+
#if UNITY_2018_1_OR_NEWER
7075
protected void InitializeReceiver(){
7176
if (!m_receiver) {
7277
m_receiver = ScriptableObject.CreateInstance<FbxExportPresetSelectorReceiver> () as FbxExportPresetSelectorReceiver;
@@ -76,6 +81,7 @@ protected void InitializeReceiver(){
7681
m_receiver.DialogClosed += SaveExportSettings;
7782
}
7883
}
84+
#endif
7985

8086
public void SetFilename(string filename){
8187
// remove .fbx from end of filename
@@ -110,6 +116,7 @@ protected virtual bool DisableNameSelection(){
110116
return false;
111117
}
112118

119+
#if UNITY_2018_1_OR_NEWER
113120
protected abstract void ShowPresetReceiver ();
114121

115122
protected void ShowPresetReceiver(UnityEngine.Object target){
@@ -118,6 +125,7 @@ protected void ShowPresetReceiver(UnityEngine.Object target){
118125
m_receiver.SetInitialValue (new Preset (target));
119126
UnityEditor.Presets.PresetSelector.ShowSelector(target, null, true, m_receiver);
120127
}
128+
#endif
121129

122130
protected void OnGUI ()
123131
{
@@ -126,10 +134,14 @@ protected void OnGUI ()
126134

127135
GUILayout.BeginHorizontal ();
128136
GUILayout.FlexibleSpace ();
129-
if (EditorGUILayout.DropdownButton (presetIcon, FocusType.Keyboard, presetIconButton)) {
137+
138+
#if UNITY_2018_1_OR_NEWER
139+
if(EditorGUILayout.DropdownButton(presetIcon, FocusType.Keyboard, presetIconButton)){
130140
ShowPresetReceiver ();
131141
}
132-
GUILayout.EndHorizontal ();
142+
#endif
143+
144+
GUILayout.EndHorizontal();
133145

134146
EditorGUILayout.LabelField("Naming");
135147
EditorGUI.indentLevel++;
@@ -364,10 +376,12 @@ protected override void Export(){
364376
}
365377
}
366378

379+
#if UNITY_2018_1_OR_NEWER
367380
protected override void ShowPresetReceiver ()
368381
{
369382
ShowPresetReceiver (ExportSettings.instance.exportModelSettings);
370383
}
384+
#endif
371385
}
372386
}
373387
}

Assets/FbxExporters/Editor/FbxExportPresetSelectorReceiver.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections;
1+
#if UNITY_2018_1_OR_NEWER
2+
using System.Collections;
23
using System.Collections.Generic;
34
using UnityEngine;
45
using UnityEditor.Presets;
@@ -45,4 +46,5 @@ public void SetTarget(UnityEngine.Object target){
4546
public void SetInitialValue(Preset initialValue){
4647
m_InitialValue = initialValue;
4748
}
48-
}
49+
}
50+
#endif

Assets/FbxExporters/Editor/FbxExportPresetSelectorReceiver.cs.meta

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)