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
- Type: Class
- Namespace: UnityEngine.AdaptivePerformance
- Assembly: UnityEngine.AdaptivePerformanceModule
- Inherits from: ScriptableObject
public abstract class AdaptivePerformanceScaler : ScriptableObject
Fields
Value | Description |
|---|---|
| m_Settings | Settings reference for all scalers. |
Properties
Property | Description |
|---|---|
| BatteryModeSetting | Default settings for this scaler in battery mode. |
| CpuImpact | Scaler impact on CPU so far in milliseconds. |
| CurrentLevel | Returns the current level of scale. |
| DefaultSetting | Default settings for this scaler in normal mode. |
| Enabled | Returns |
| GpuImpact | Scaler impact on GPU so far in milliseconds. |
| IndexerOperationMode | Returns the current operation mode of the indexer. |
| IsMaxLevel | Returns |
| MaxBound | Returns the maximum boundary of this scaler. |
| MaxLevel | Returns the maximum level of this scaler. |
| MinBound | Returns the minimum boundary of this scaler. |
| Name | Returns a string with the name of the scaler. |
| NotLeveled | Returns |
| OverrideLevel | Allows 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. |
| Scale | Returns a generic scale of this scaler in range [0,1] which is applied to the quality. |
| Target | Returns the bottlenecks that this scaler targets. |
| VisualImpact | Returns the visual impact of scaler when applied. |
Methods
Method | Description |
|---|---|
| ApplyBatteryModeSetting | Apply 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. |
| ApplyDefaultSetting | Any 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. |
| ApplyProfileSettings | Hydrates 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. |
| Awake | Ensures settings are applied during startup. |
| CalculateCost | Calculate the cost of applying this particular scaler. |
| OnDisabled | Callback when scaler gets disabled and removed from indexer |
| OnEnabled | Callback when scaler gets enabled and added to the indexer |
| OnLevel | Callback for any level change |
| OnLevelDecrease | Callback for when the performance level is decreased. |
| OnLevelIncrease | Callback for when the performance level is increased. |
| OnOperationMode | Callback every frame for actions in a specific mode. |
| ScaleChanged | Checks if scale changed based on the current level and returns true if scale changed false otherwise. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |