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
- Location tooltip in the Viewport of UI Builder window does not update when the UI Document Asset is moved to a different location
- Audio Clip Volume and Avoid Repeating Last fields values cannot be changed in Audio Random Container window
- Setting a variable in the root selector via an imported USS file in a theme does not work
- No character limit when creating a new Scene with excessively long name, Editor can be forced to crash
- URP Decal Projector flickers/glitches when added to Cube or Quad GameObjects as a Component
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
...