
:max_bytes(150000):strip_icc()/EclipseSDK-5aba8385875db9003789091f.png)
else structure, which would only bypass the execution of certain portions of code at run time. It is omitted entirely when compiled in the Editor, or in other target builds. Therefore in the above example, the Debug line is only included for compilation in the Windows standalone build of the project. The hash ( #) character in front of the if and endif indicates that these statements are “directives”, and are handled during the compilation process, rather than at runtime. You can check whether this symbol is defined using a special type of if statement, as follows: #if UNITY_STANDALONE_WIN More info See in Glossary to selectively include or exclude portions of code from compilation.įor example, the built-in scripting symbol that is set when a player is built for Windows standalone platform is UNITY_STANDALONE_WIN. Unity has a range of built-in scripting symbols which represent options that you can use in your scripts A piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. You can read more broadly about how these directives work in C# on the Microsoft C# preprocessor directives page. Unity’s support for the C# language includes the use of directives, which allow you to selectively include or exclude code from compilation, based on whether certain scripting symbols are defined or not defined.
