Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AdaptivePerformanceScaler

Abstract class representing single feature that is controlled by AdaptivePerformanceIndexer. You control the quality through changing the levels, where 0 represents the controller not being applied and 1,2... as applied. As a result, a higher level represents lower visuals, but better performance.
Read time 6 minutesLast updated 4 days ago

Definition

public abstract class AdaptivePerformanceScaler : ScriptableObject

Fields

Value

Description

m_SettingsSettings reference for all scalers.

Properties

Property

Description

BatteryModeSettingDefault settings for this scaler in battery mode.
CpuImpactScaler impact on CPU so far in milliseconds.
CurrentLevelReturns the current level of scale.
DefaultSettingDefault settings for this scaler in normal mode.
EnabledReturns
true
if this scaler is active, otherwise returns
false
. Routed through ActiveSetting, so reads and writes target the current mode's per-mode settings struct. Switching IAdaptivePerformanceSettings.IndexerOperationMode changes which struct this getter reads from, so per-mode enabled state takes effect on mode change without any explicit sync.
GpuImpactScaler impact on GPU so far in milliseconds.
IndexerOperationModeReturns the current operation mode of the indexer.
IsMaxLevelReturns
true
if the scaler can no longer be applied, otherwise returns
false
.
MaxBoundReturns the maximum boundary of this scaler.
MaxLevelReturns the maximum level of this scaler.
MinBoundReturns the minimum boundary of this scaler.
NameReturns a string with the name of the scaler.
NotLeveledReturns
true
if the scaler is not applied, otherwise returns
false
.
OverrideLevelAllows you to manually override the scaler level. If the value is -1, AdaptivePerformanceIndexer will handle levels, otherwise scaler will be forced to the value you specify.
ScaleReturns a generic scale of this scaler in range [0,1] which is applied to the quality.
TargetReturns the bottlenecks that this scaler targets.
VisualImpactReturns the visual impact of scaler when applied.

Methods

Method

Description

ApplyBatteryModeSettingApply battery mode settings to the scaler. This allows scalers to have separate configurations for normal and battery operation modes. This is used by Scaler Profiles to apply battery mode settings.
ApplyDefaultSettingAny scaler with settings in IAdaptivePerformanceSettings needs to call this method and provide the scaler specific setting. Unity uses the setting arguments in the base-scaler as the default settings. This is also used by Scaler Profiles to apply their Settings.
ApplyProfileSettingsHydrates this scaler from a profile setting in one shot: installs the per-mode override for every mode (default / battery). Enabled state rides inside each mode's settings struct, so applying the per-mode structs is sufficient — AdaptivePerformanceScaler.Enabled reads from the active struct via ActiveSetting. Intended for subclasses to call from Awake with their own typed setting, e.g. ApplyProfileSettings(m_Settings.scalerSettings.AdaptivePhysics). No-op if setting is null.
AwakeEnsures settings are applied during startup.
CalculateCostCalculate the cost of applying this particular scaler.
OnDisabledCallback when scaler gets disabled and removed from indexer
OnEnabledCallback when scaler gets enabled and added to the indexer
OnLevelCallback for any level change
OnLevelDecreaseCallback for when the performance level is decreased.
OnLevelIncreaseCallback for when the performance level is increased.
OnOperationModeCallback every frame for actions in a specific mode.
ScaleChangedChecks if scale changed based on the current level and returns true if scale changed false otherwise.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.