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
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
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