Search Issue Tracker
Fixed
Fixed in 2022.2.0a8, 2023.1.0a17
Votes
0
Found in
2022.2.0a8
2023.1.0a11
Issue ID
UUM-14454
Regression
Yes
Can't add a Script to a GameObject when the Script contains 2 partial classes in the same file
Reproduction steps:
- Open the attached project
- Drag the “/Assets/PartialClass.cs” from the Project window onto any GameIbject in the Hierarchy window
- Observe
Expected result: The Script is added as a Component to the GameObject
Actual result: “Can’t add script” error window pops up
Reproducible with: 2022.2.0a5, 2022.2.0b8, 2023.1.11f1
Not reproducible with: 2020.3.39f1, 2021.3.10f1, 2022.1.17f1, 2022.2.0a4
Reproducible on: M1 MacOS 12.4 (21F79), Windows 10 (21H2)
Notes:
- This happens when a single Script file contains 2 partial classes and one of them inherits from MonoBehavior, if you split these 2 partial classes into 2 separate Script files with one partial class each, it works as expected
- The issue is reproducible on both Intel and Apple Silicon Editors on M1 Mac
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
Resolution Note (fix version 2022.2.0a8):
Issue has been fixed and has landed in 2022.2