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

DiagnosticParams

class in Unity.ProjectAuditor.Editor


Implements interfaces:ISerializationCallbackReceiver

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

Description

Provides numeric parameters with arbitrary names and defaults, with optional overrides for individual target build platforms.

When deciding whether to report a diagnostic issue, some Analyzers need to compare a value extracted from the project with an arbitrary threshold value: For example, when reporting that the project contains textures larger than some specified size. DiagnosticParams are saved in the ProjectAuditorSettings asset, which should be included in the project's version control repository. By default, every AnalysisParams is constructed with a copy of the global DiagnosticParams for use during analysis. Individual parameters can be overridden on different platforms (for example, to set different texture size thresholds on different target platforms). DiagnosticParams will return the parameter value that corresponds to the target platform, or the default parameter if there is no override for the platform.

Constructors

Constructor Description
DiagnosticParams Default constructor

Public Methods

Method Description
DoGUI Draw project settings GUI for a specific BuildTargetGroup.
GetDefault Get the default value for this parameter.
GetParameter Get the value of a named parameter. The parameter must have previously been registered with the RegisterParameter method.
GetTooltip Get the tooltip for this parameter.
GetUserFriendlyName Get the user friendly name for this parameter.
OnAfterDeserialize Unity calls this method automatically after deserialization.
OnBeforeSerialize Unity calls this method automatically before serialization.
RegisterParameter Register a parameter by declaring its name and default value. Parameters are registered on the "default" platform, so are available for retrieval on every target platform.
SetAnalysisPlatform Sets the target analysis platform. When retrieving parameters, DiagnosticParams will first check the values specific to this platform.
SetParameter Set the value of a named parameter for a given analysis platform.