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
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
This is a duplicate of issue #1071188