docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Preprocessor directives

    If you have code inside a preprocessor directive (for example, #if MY_CONSTANT <code> #endif) and you want this code to have its API documented, you can use the Package Manager Doc Tools (PMDT) preprocessor directives to make sure that it generates documentation for these APIs.

    PMDT adds the PACKAGE_DOCS_GENERATION directive to all generated code projects submitted to DocFX when it generates the API documentation, so you can add this to your code (for example, #if MY_CONSTANT || PACKAGE_DOCS_GENERATION <code> #endif).

    Or, you can tell PMDT which preprocessor directives to enable when it generates the documentation.

    Specify additional preprocessor directives in package metadata.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)