Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2022.2.12f1
2023.1.0b10
2023.2.0a8
Issue ID
UUM-31850
Regression
Yes
Script Component is treated as an Editor script when attaching to GameObject and when there are two partial classes with the same name and file name in the project
Reproduction steps:
1. Open the attached "repro_IN-36142WrongMessage.zip" project
2. Open the "Assets/Scenes/SampleScene" Scene
3. In the Hierarchy window, select the "TestObject" GameObject
4. In the Project window, drag and drop the "Assets/FirstPartClass" script to the Inspector window
5. Observe the error message
Expected result: The error message shows "Can't add script component 'FirstPartClass' because the script class cannot be found..."
Actual result: The error message shows "The script is an editor script."
Reproducible with: 2022.2.9f1, 2022.2.13f1, 2023.1.0b10, 2023.2.0a8
Not reproducible with: 2022.2.8f1
Could not test with: 2020.2.46f1, 2021.3.22f1 (There is no error message)
Reproduced on: Windows 10
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:
This is an improvement, as we need to know what *.cs file a given class is coming from. This is because that file will act as the one dependencies will be setup on, ie. for attaching to gameobjects, serialization ect.
Before the behavior could be inconsistent because it would depend on order, now we highlight the issue with a error and can consistently get the same file for a class.
Resolution Note (2023.2.X):
This is an improvement, as we need to know what *.cs file a given class is coming from. This is because that file will act as the one dependencies will be setup on, ie. for attaching to gameobjects, serialization ect.
Before the behavior could be inconsistent because it would depend on order, now we highlight the issue with a error and can consistently get the same file for a class.