Class ProjectAuditor
The ProjectAuditor class is responsible for auditing the Unity project.
Inherited Members
Namespace: Unity.ProjectAuditor.Editor
Assembly: Unity.ProjectAuditor.Editor.dll
Syntax
public sealed class ProjectAuditor : IPostprocessBuildWithReport, IOrderedCallback
Constructors
ProjectAuditor()
ProjectAuditor default constructor
Declaration
public ProjectAuditor()
Properties
KnownUnityVersions
Returns a list of Unity versions that is known to Project Auditor. It is based on the content in the Obsolete API Database.
Declaration
public static IReadOnlyList<string> KnownUnityVersions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
callbackOrder
Returns the relative callback order for callbacks. Callbacks with lower values are called before ones with higher values.
Declaration
public int callbackOrder { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Audit(AnalysisParams, IProgress)
Performs static analysis of the project, using the supplied analysis parameters.
Declaration
public Report Audit(AnalysisParams analysisParams, IProgress progress = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalysisParams | analysisParams | Parameters to control the audit process |
| IProgress | progress | Progress bar, if applicable |
Returns
| Type | Description |
|---|---|
| Report | Generated report |
Audit(IProgress)
Performs static analysis of the project, using default parameters.
Declaration
public Report Audit(IProgress progress = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IProgress | progress | Progress bar, if applicable |
Returns
| Type | Description |
|---|---|
| Report | Generated report |
AuditAsync(AnalysisParams, IProgress)
Performs asynchronous static analysis of the project, using the supplied analysis parameters.
Provide a callback to the OnCompleted Action in analysisParams to obtain the Report when analysis is completed.
Declaration
public void AuditAsync(AnalysisParams analysisParams, IProgress progress = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AnalysisParams | analysisParams | Parameters to control the audit process |
| IProgress | progress | Progress bar, if applicable |
OnPostprocessBuild(BuildReport)
Callback function which is called after a build is completed. If UserPreferences.AnalyzeAfterBuild is true, performs a full audit and logs the number of issues found.
Declaration
public void OnPostprocessBuild(BuildReport report)
Parameters
| Type | Name | Description |
|---|---|---|
| BuildReport | report | A report containing information about the build, such as its target platform and output path. |