Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2020.3.48f1
2021.3.26f1
2022.2.21f1
2023.1.0b18
2023.2.0a17
Issue ID
UUM-36614
Regression
No
Types from serialized references on Prefabs are not updated when moving Scripts among assemblies
Reproduction steps:
1. Open the attached “1563442.zip“ project
2. Move the “CustomPassTest.cs” Script to the “Assembly1" folder
3. Select “PrefabCamera.prefab” Prefab and observe the Console
Expected result: No errors are thrown
Actual result: “ArgumentNullException: Value cannot be null. Parameter name: key” errors are thrown
Alternate reproduction steps:
1. Open the attached “1563442.zip“ project
2. Open “PrefabCamera.prefab” with any text editor
3. Observe the type of the Custom Pass Object
4. Move the “CustomPassTest.cs” Script to the “Assembly1" folder in the Editor
5. Repeat steps 2-3
Alternate expected result: The type of the Custom Pass Object is updated
Alternate actual result: The type of the Custom Pass Object is not updated
Reproducible with: 2020.3.48f1, 2021.3.26f1, 2022.2.21f1, 2023.1.0b18, 2023.2.0a17
Reproduced on: macOS Ventura 13.3.1 (Intel)
Note: Not reproducible in Player
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
Moving scripts among assemblies can not be automatically detected. This is a limitation caused by the design of the SerializedReference-s. However there is an attribute called "MovedFrom" which allows to specify if a script has been moved from another assembly, namespace or class with another name. the attribute can be used like this:
After the script is moved to another assembly, add the MovedFrom attribute to it showing what was the original assembly the script was in
[MovedFrom(true, sourceAssembly:"Assembly-CSharp")]
class CustomPassTest : CustomPass
Resolution Note (2023.2.X):
Moving scripts among assemblies can not be automatically detected. This is a limitation caused by the design of the SerializedReference-s. However there is an attribute called "MovedFrom" which allows to specify if a script has been moved from another assembly, namespace or class with another name. the attribute can be used like this:
After the script is moved to another assembly, add the MovedFrom attribute to it showing what was the original assembly the script was in
[MovedFrom(true, sourceAssembly:"Assembly-CSharp")]
class CustomPassTest : CustomPass