![]() ![]() These built-in scripting symbols are listed below. There are a number of built-in scripting symbols which allow you to selectively compile or omit code based on the selected Platform, the Editor Version, and other miscellaneous system environment scenarios. else structure, which might only bypass the execution of certain part of code at runtime. ![]() When compiled in the Unity Editor or in other target builds, it’s omitted entirely. 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 they’re handled during the compilation process, rather than at runtime. You can check whether this symbol is defined using a special type of if statement using the following query: #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’s 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# in Microsoft’s user documentation on C# preprocessor directives. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |