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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
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.