Can I have multiple platform #define directives in the same #if statement?

Hello, I just wanted to know if the below code is fine/not a problem later down the line or would I have to copy paste the chunk of code for individual #if statement’s? Example Below:

Does this work:

#if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX
print("This is a test");
#endif

Or would I have to do this:

#if UNITY_EDITOR
print("This is a test");
#endif

#if UNITY_STANDALONE_WIN
print("This is a test");
#endif

#if UNITY_STANDALONE_OSX
print("This is a test");
#endif

It does work yes. You can even do more complex things like this :

#define TEST
#if (UNITY_EDITOR && TEST) || !(UNITY_IOS || UNITY_ANDROID)
print("This is a test");
#endif

it’ll work; you could just try it too… :wink: