Search Issue Tracker
Won't Fix
Won't Fix in 2022.1.X
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
- [Linux] Cannot reorder GameObjects in the Hierarchy when the AI Assistant package is installed
- [iOS] Text Input field stops receiving changes when the "Cancel" button is used on the soft keyboard
- [WebGPU] URP RenderGraph RenderPass doesn't clear textures
- Query Builder items display raw code style names instead of human readable labels in search field
- “+” button does nothing and has no functionality when clicked in Human Template "Bone Template" list
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 :)
Resolution Note (2022.1.X):
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 :)