Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.35f1
2021.3.3f1
2022.1.2f1
Issue ID
UUM-759
Regression
Yes
MonoBehaviours are not recognized when using a preprocessor directive in an attribute field with a comma
How to reproduce:
1. Open the attached project ("monobehaviourPreprocessorBug.zip")
2. Click on the "ScriptWithAttributeCommaInNamespace" script (Assets -> Scripts -> ATestNamespace)
Expected result: The script is recognized as a MonoBehaviour
Actual result: "No MonoBehavior scripts in the file, or their names do not match the file name." warning is shown in the Inspector
Reproducible with: 2020.1.0a15, 2020.3.35f1, 2021.3.3f1, 2022.1.2f1, 2022.2.0a2
Not reproducible with: 2019.4.39f1, 2020.1.0a14, 2022.2.0a3, 2022.2.0a15
Reproducible on: macOS 12.1 (Intel)
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
- Long Tile Palette name breaks window UI
- UI Builder Project Library foldouts do not open when pressed on the foldout name
- Shader Graph Create Node window cannot be resized or moved after maximizing and reopening it
- [Usability] Cannot toggle Scene checkboxes using TAB/Enter in Build Profiles’ > Open Scene List
- Installing HDRP package throws Shader Graph validation warning about Exposure node when installed in Universal 3D Template
Resolution Note:
This should be fixed in the latest version of Unity, the comma is not the issue, is the #if statement.
The workaround is to just have the #if statements and then the attributes inside those #if statements :)