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
- Crash on GUIManager::DoGUIEvent when focusing on the Game view window on a specific project
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
- Graphics State Collection warm-up does not work when using with Addressables Shaders
- "Baked Shadow Radius" field is visible but inactive when when the Shadow Type is set to "Hard Shadows" under the Light Component
This is a duplicate of issue #1071188