Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

Grey syntax color issue in `#if !UNITY_EDITOR ~ #endif` in VS 2015.

shinyeyesshinyeyes
edited May 2017 in Questions And Answers

Hi,

Every code between #if !UNITY_EDITOR && UNITY_METRO and #endif becomes grey in VS 2015 Update 3. How do I bring the color back? They are colored in VS CODE but not in VS(Visual Studio).

Update
Is this true that this logic is by its product design? Read this

Best Answer

Answers

  • did you open this code through Unity?

  • @Xarthisius: Yes. I opened the code by clicking the .sln which is created by Unity.

  • trzytrzy ✭✭✭
    Just to clarify further: when I say "inactive", I mean the code is completely ignored by the compiler. You can type anything there, even something that is not code (like "trzy is the coolest guy in the universe") and it will still compile and work. It is the same as commenting out the code entirely but only when building for Unity.

    When you build a standalone project for deployment, the macro is no longer defined and the compiler will see the code, and the IDE will be aware of that.
  • What you are actually seeing the the PDC (Platform Dependent Compilation) macro. I believe it is "as designed" and there are some cases where if the conditions is not met, it will not un-grey.

    You can check the Unity docs on PDC here > https://docs.unity3d.com/Manual/PlatformDependentCompilation.html

  • @trzy, @MattFedoCSG : Thank you for your replies.
    I understand why they are grey. I want the syntax color back so I can easily code.
    It's not only the color that's bothering. You can't jump to definition of properties and methods either.

  • trzytrzy ✭✭✭
    Did my suggestion work? Open the sln file generated when you generate the app project ("Build and Run..." in Unity)...
  • @trzy & @MattFedoCSG: Thank you for your answers and apologies for the late reply. Your solutions worked for me :)

Sign In or Register to comment.