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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
This is a duplicate of issue #1071188