Pre-Processor Directives
Last updated
Last updated
The code below is called a preprocessor directive and is only valid if the build is for Android or iOS platform or else the compiler will ignore this code
C# preprocessor directives | Microsoft Docs
I could make 2 separate scripts, 1 for Windows & 1 for Android, but since most of the code is similar instead of repeating myself I can just implement a preprocessor directive. To see what preprocessor directives are in your Unity Project you can go to File/Build Settings/Player Settings/Player/Other Settings/Scripting Define Symbols
This doesn't list every available preprocessor directive, such as the PLATFORM_ANDROID
shown above
or
Edit/Project Settings/Player/Other Settings/Scripting Define Symbols