Skip to content

Commit 2a2f8ad

Browse files
authored
Merge pull request #108 from immersivecognition/personal/jack/2022-improvements
fixes for editor helpers in unity 2021+
2 parents e174479 + 864d31d commit 2a2f8ad

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
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)

Assets/UXF/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.6
1+
2.3.7

0 commit comments

Comments
 (0)