文档

Unity Engine

Unity Engine

条件编译

Use and define preprocessor directives to selectively include or exclude sections of your code for compilation.
阅读时间1 分钟最后更新于 1 个月前

本节介绍了使用预处理器指令和脚本符号来进行 C# 代码各部分的条件编译。

主题

描述

Unity 中的条件编译有关如何以及何时在 Unity 脚本中使用条件编译的概述。
Unity 脚本符号参考Unity 提供的预定义脚本符号参考。
自定义脚本符号通过 Editor UI、脚本或使用资源文件创建自定义脚本符号。
测试条件编译代码示例和条件编译代码测试步骤。

其他资源