Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.2.0a6

2018.3.0a1

2018.3.8f1

2019.1.0a1

2019.2.0a1

Issue ID

1136864

Regression

Yes

EditorGUILayout.PropertyField ignores SerializedProperty selections from a drop-down menu

IMGUI

-

How to reproduce:
1. Open tester-attached project (SerializedProperty)
2. Open 'SampleScene' scene
3. Select the 'TestClass' GameObject
4. In the Inspector window attempt to select a different 'Collider Mask' or 'Selection' property

Expected result: the selection changes
Actual result: the selection does not change

Reproducible with: 2018.2.0a6, 2018.3.9f1, 2019.1.0b7, 2019.2.0a8
Not reproducible with: 2017.4.23f1, 2018.2.0a5

Notes:
Can be fixed by replacing:

public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(avoidanceMask, new GUIContent("Collider Mask"));
EditorGUILayout.PropertyField(sel, new GUIContent("Selection"));
}

with:

public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(avoidanceMask, new GUIContent("Collider Mask"));

EditorGUILayout.PropertyField(sel, new GUIContent("Selection"));
serializedObject.ApplyModifiedProperties();
}

  1. Resolution Note (2019.3.X):

    The issue can be fixed by making changes to the script itself, see the description field for the working script

Add comment

Log in to post comment