Copyright © 2026 Unity Technologies
Currently the serialization system serializes class fields in the order of their declaration and there is no mechanism for detecting which one of two lists was modified, to be able to prevent the override of the modified list. In the case of the repro project this is what happens: When user modifies one of the lists in the inspector a serialization of the corresponding scriptable object is triggered. First the list named "source" is serialized, and after that the list target is serialized. As both target and source point to the same location in the memory, whatever values the list "target" has will override the values of the source, even if the user modified the source. Note that if the order of the fields declaration changes in the class (e.g. source list is the second and the target is the first), then you'll see the opposite issue, where you can modify the source but not the target.
Reproduction steps:
1. Open the attached project “DualReferenceIssue”
2. In the Project window select “Assets/Resources/New Dual Reference Scriptable Object.asset” asset
3. In the Inspector window try adding and changing the values of the “Source List” array
4. Try adding/removing and changing the values of the “Target List” array
Expected result: Editing values in any array the changes are represented in another array
Actual result: Only the “Target List” array elements can be edited and they are copied to the “Source List” array
Reproducible with: 2021.3.29f1, 2022.3.6f1, 2023.1.7f1, 2023.2.0b3
Reproducible on: macOS 13.4.1 (c)
Notes:
Issues you vote on will appear here