Version: Unity 6.4 Alpha (6000.4)
LanguageEnglish
  • C#

AnalysisContext.IsDescriptorEnabled

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public bool IsDescriptorEnabled(Unity.ProjectAuditor.Editor.Descriptor descriptor);

Parameters

Parameter Description
descriptor The descriptor to check

Returns

bool True if the Descriptor is applicable to the current target platform and Unity version, and if it's either enabled by default or by a Rule specified in Params. Otherwise, returns false.

Description

Checks whether a given Descriptor is enabled for the current analysis.

The analysis for some Issues can take a long time to run, particularly in a large project. The Descriptors for such issues may declare Descriptor.IsEnabledByDefault to be false to stop them running when running Project Auditor interactively in the Editor. When running Project Auditor in a CI/CD environment it may be desirable to re-enable analysis for these Descriptors. AnalysisParams.WithAdditionalDiagnosticRules can be used to add temporary Rules to increase the Severity of a Descriptor to anything other than Severity.None in order to re-enable analysis in this context.