Search Issue Tracker

Duplicate

Votes

0

Found in

2019.3

2019.3.0f6

2020.1

Issue ID

1219332

Regression

No

[SerializeReference] fields of classes derived from System.Object invalidate other serialized fields in Prefab instances

Serialization

-

Steps to reproduce:
1. Open the attached project (case_1219332.zip)
2. Enter Play Mode
3. Observe that hashes match for all objects as logged through the Console (most importantly, "Reference Object Hash" & "Child Object Hash")
4. Open TestScript.cs
5. Uncomment line 12
6. Enter Play Mode

Expected result: Hashes match and serialized field of each instance correctly points to its child (if "Reference Object Hash" line is not logged, compare the random number of each hash pair)
Actual result: Hashes do not match except for one and only one instance

Reproduced in: 2019.3.2f1, 2020.1.0a23
Cannot test with: 2017.4.37f1, 2018.4.17f1 (Serialization by reference unavailable)

Note:
- If EmptyClass is derived from UnityEngine.Object, the issue is not reproducible
- The issue is also not reproducible if EmptyClass is changed to System.Object in the [SerializeReference] field

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.