Skip to content

Commit 34deeea

Browse files
fixes for editor helpers in unity 2021+
1 parent 5a0054e commit 34deeea

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Assets/UXF/Prefabs/[UXF_Rig].prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4040,6 +4040,7 @@ MonoBehaviour:
40404040
m_PersistentCalls:
40414041
m_Calls: []
40424042
sortDataIntoFolders: 1
4043+
forceENUSLocale: 1
40434044
verboseDebug: 0
40444045
--- !u!1 &4157116251522641278
40454046
GameObject:

Assets/UXF/Scripts/Etc/Editor/EasyEventEditor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ public class EasyEventEditorHandler
5959
private const string eeeGroupSameComponentTypeKey = "EEE.groupSameComponentType";
6060
private const string eeeUseHotkeys = "EEE.usehotkeys";
6161

62+
#if UNITY_2021_1_OR_NEWER
63+
// no need in Unity 2021
64+
#else
6265
private static bool patchApplied = false;
66+
#endif
6367
private static FieldInfo internalDrawerTypeMap = null;
6468
private static System.Type attributeUtilityType = null;
6569

Assets/UXF/Scripts/Etc/ReorderableInspector/Editor/ReorderableArrayInspector.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,21 @@ public bool DoLayoutProperty(SerializedProperty property)
179179

180180
// Draw the header
181181
string headerText = string.Format("{0} [{1}]", property.displayName, property.arraySize);
182-
EditorGUILayout.PropertyField(property, new GUIContent(headerText), false);
182+
183+
bool drawChildren;
184+
#if UNITY_2020_2_OR_NEWER
185+
EditorGUILayout.PropertyField(property, new GUIContent(headerText), true);
186+
drawChildren = false;
187+
#else
188+
EditorGUILayout.PropertyField(property, new GUIContent(headerText), false);
189+
drawChildren = property.isExpanded;
190+
#endif
183191

184192
// Save header rect for handling drag and drop
185193
Rect dropRect = GUILayoutUtility.GetLastRect();
186194

187195
// Draw the reorderable list for the property
188-
if (property.isExpanded)
196+
if (drawChildren)
189197
{
190198
int newArraySize = EditorGUILayout.IntField("Size", property.arraySize);
191199
if (newArraySize != property.arraySize)

0 commit comments

Comments
 (0)