Search Issue Tracker

By Design

Votes

0

Found in

2018.3.0a6

2018.3.0b1

Issue ID

1082565

Regression

Yes

SerializedProperty.PropertyField is not editable in an EditorWindow when it is used for a Prefab Script field

IMGUI

-

How to reproduce:
1. Open the attached "TestFor1082565.zip" project
2. In the top menu bar click Test -> My Window
3. In the recently opened window notice that the check box is greyed out

Expected result: Serialized field is editable
Actual result: Serialized field is not editable

Reproducible with: 2018.3.0a6, 2018.3.0b2, 2019.1.0a1
Not reproducible with: 2017.2.3p4, 2017.4.11f1, 2018.2.9f1, 2018.3.0a5

Note: Opening the project on the affected versions corrupts it and then the issue is reproducible across all the versions

  1. Resolution Note (2018.3.X):

    Since the behaviour of Prefabs changed, there are new APIs that the user will need to rely on.
    The APIs are:

    PrefabUtility.LoadPrefabContents and PrefabUtility.SaveAsPrefab

    In his example, this can be modified to calling

    PrefabUtility.LoadPrefabContents inside the Init() function,

    and calling PrefabUtility.SaveAsPrefab if the call to so.ApplyModifiedProperties() is successful.

    Refer to reply for sample code change.

Add comment

Log in to post comment

All about bugs

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