# using #if UNITY_EDITOR && !UNITY_ANDROID greys out the code

I'm trying to exclude part of my code when building(android) but keeping it while in the editor for testing purposes.

Using #if UNITY_EDITOR only will result in this code getting built, but using #if UNITY_EDITOR && !UNITY_ANDROID will grey out the code making it unusable in play mode.

The editor grays them out to remind you the code doesn't work in the current build platform you chose.

For example if in the editor you have chosen Android as the current build platform, it will gray out code that is on other platforms to remind you that this code only works on Android build.

Sometimes you'll write code for debug and testing, so you'll put it in UNITY_EDITOR so it only works in Unity editor.

When you write:

#if (UNITY_EDITOR && !UNITY_ANDROID)

#if !UNITY_ANDROID