Search Issue Tracker
Duplicate
Votes
0
Found in
2018.2.3f1
Issue ID
1069915
Regression
No
Using "using static" in a namespace MonoBehaviour type will break the parser and Unity will no longer see it as a MonoBehaviour
To reproduce:
1. Download attached project "UsingStaticMonoBehaviourRepro.zip" and open in Unity
2. Inspect "MonoBehaviourWithUsingStaticWithoutNamespace.cs" and observe that it works normally
3. Inspect "MonoBehaviourWithUsingStaticWithNamespace.cs" and observe that it is reported as not being a MonoBehaviour
Notes:
- This issue appears on both Windows and OSX
- Both scripts are identical, except for their name and the fact that one is in a namespace, while the other is not
- Removing the namespace from the "MonoBehaviourWithUsingStaticWithNamespace.cs" will make it work
- The issue has been known for a long time and is also present in this integration: https://bitbucket.org/alexzzzz/unity-c-5.0-and-6.0-integration/
Reproduced on Unity 2017.1.5f1, 2017.2.3p3, 2017.3.2f1, 2017.4.9f1, 2018.1.9f1, 2018.2.3f1 and 2018.3.0a9
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
- "Property (urp_ReflProbes_BoxMin) exceeds previous array size" warning spams console after switching platforms
- Have to change Input Mapping Path twice for change to take effect when Auto-Save is enabled
- No Duplicate option is available when right clicking States in the Animator Window even though it's available via Shortcut
- Copied and Pasted States appear in a set location instead of where the Users cursor is located at when using the Pasting Shortcut
- Animator Component information box text is not centered
This is a duplicate of issue #1071188