Version: Unity 6.2 Alpha (6000.2)
Language : English
Stack trace logging
Create and use a source generator

Roslyn analyzers and source generators

Use Roslyn analyzers, source generators and ruleset files in Unity projects to inspect your code for style, quality, and other issues.

You can use existing analyzer libraries to inspect your code, and write your own analyzers to promote the best practices or conventions within your organization.

Note: Roslyn analyzers are only compatible with the IDEs that Unity publicly supports, which are Visual Studio and JetBrains Rider.

For more information about how to write and use Roslyn analyzers, refer to Microsoft’s Analyzer Configuration and Get started with Roslyn analyzers documentation.

Topic Description
Create and use a source generator Create a simple source generator and configure the Unity Editor to use it for your Unity project code.
Install and use an existing analyzer or source generator Download an existing code analyzer or source generator and configure the Unity Editor to use it for your Unity project code.
Additional files for Roslyn analyzers and source generators Define additional text files for Roslyn analyzers or source generators to use.
Create rule set files Create rule sets to customize the standards your code analysis tools enforce.
Code analyzer scope and diagnostics Control which parts of your code are subject to code analysis and get insights into how long analysis is taking.

Additional resources

Stack trace logging
Create and use a source generator
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961