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
- Other threads get resized when trying to resize thread groups on the Timeline of the Profiler window
- Green highlight for selected panel lacks contrast when Editor theme is set to Light
- [Android] AR Camera Background has a white/bright tint when deployed with Gamma Color Space and Vulkan API
- Crash on TextCore::OTL_GPOS_TableReader::GetLookupList when changing to a specific Font in the UI Builder
- Reverting [SerializeReference] List property creates persistent element overrides in Prefab Variants
This is a duplicate of issue #1071188