Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2020.3.18f1
2021.3
2022.1
2022.2
Issue ID
1418497
Regression
No
"This Object contains SerializeReference types which are missing." warning appears when renaming the class or namespace
Reproduction steps:
1. Open the attached "SerializeReference_1209838.zip" project
2. Open the "SampleScene" Scene
3. Go to Hierarchy > Test > Reference and see that the value of the "Value" variable is "2"
4. Change the name of the "TestBehaviour" class or "MyNS" namespace in "SerializeReferenceTest.cs" and "TestBehaviour.cs" scripts
5. Go to Hierarchy > Test > Reference
Expected result: The value of the "Value" variable is "2"
Actual result: The value of the "Value" variable is "0" or "This Object contains SerializeReference types which are missing." warning appears, and the "Reference" field is not displayed
Reproducible with: 2019.4.37f1, 2020.3.33f1, 2021.3.0f1, 2022.1.0b14, 2022.2.0a10
Notes:
- If you open the "Test.prefab" asset after the 4th step, you will see that the reference is laid out as (renamed class or namespace are not updated):
references:
version: 1
00000000:
type: {class: TestBehaviour, ns: MyNS, asm: Assembly-CSharp}
data:
Value: 2
- The warning message appears in 2021.2.0a12 and above
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2022.2.X):
When using [SerializeReference], class rename are not handled automatically. One way around the issue is to use
UnityEngine.Scripting.APIUpdating.MovedFromAttribute
More specifically, using the provided project, you can rename the behavior and successfully load the data using [MovedFrom]
[MovedFrom(false, null, null, "TestBehaviour")]
[Serializable]
public class TestBehaviour1
...