Search Issue Tracker

By Design

Votes

5

Found in

5.5.2f1

Issue ID

885364

Regression

No

Dragging prefab with serializedObject.ApplyModifiedProperties() into hierarchy during runtime calls OnDisable() method

Scripting

-

To reproduce:

1.Download and open attached project.
2.Enter Play mode.
3.Quickly drag "TestObject" prefab into Hierarchy.
4.Repeat step 3 until "OnDisable" message appears in the console.

Expected result: Editor throwing OnDisable message only when object is disabled.
Actual result: Editor throws OnDisable message when GameObject is initialized.

Reproduced with : 5.6.0b9, 5.5.2f1, 5.4.4p4, 5.3.7p4, 2018.3.0a7.

Notes: Bug reproduces after 3 to 4 instantiations of a GameObject. If You open TestInspector.cs script and comment a line where serializedObject.ApplyModifiedProperties() is called the bug does not reproduce.

  1. Resolution Note (2020.1.X):

    This is by design and will not be fixed.

Comments (3)

  1. vzlomvl

    Aug 17, 2017 22:22

    Reproduced 2017-08-18
    • Unity 2017.1.0f3

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.