Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.3.8f1

Issue ID

1136864

Regression

Yes

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

IMGUI

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 3Secondary functionality broken

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();
}

Response avatar

Resolution Note:

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

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.