Search Issue Tracker

By Design

Votes

0

Found in

2021.3.39f1

2022.3.32f1

6000.0.5f1

Issue ID

UUM-73156

Regression

No

A custom Editor window SerializedField's values returned as null until the custom window is reopened

--

-

How to reproduce:
1. Create a new project and add the attached “DialogueEditorBugReport” and “DialogueWindowBugReportTestUXML” Assets to it
2. Click Window → “New Dialogue Editor Bug Report”
3. Open the “DialogueEditorBugReport” in the Inspector and assign “DialogueWindowBugReportTestUXML” to the “Condition List Entry Template”
4. Observe the Console
5. Close the “New Dialogue Editor Bug Report” and reopen it
6. Observe the Console

Expected results: Both times “Condition template is null: False” is logged into the Console
Actual results: “Condition template is null: True” is logged after assigning the Asset and “Condition template is null: False” is logged after reopening the window

Reproducible with: 2021.3.39f1, 2022.3.32f1, 6000.0.5f1

Reproducible on: Windows 11 Pro
Not reproducible on: No other environment tested

Note:
-Unless the window is reopened, reopening the project or changing the Script to trigger the recompilation doesn’t solve the issue
-After the window is reopened the values are returned correctly even after restarting the project
-To trigger the bug again, change the “Condition List Entry Template” to None and assign the “DialogueWindowBugReportTestUXML” again

  1. Resolution Note:

    This behaviour is actually by design. The custom values, or what we call default references, are intended to apply different default values when an object is created—in this case, when a new window instance is opened. After this point, we serialize the values of the window to preserve the current state. Reapplying the default values after creation would overwrite any changes made, so the defaults are only applied upon initial creation.

    Thanks again for the bug report.

    Kind regards,
    Karl Jones

Add comment

Log in to post comment