Class 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.
Inherited Members
Namespace: UnityEngine.AdaptivePerformance
Syntax
public abstract class AdaptivePerformanceScaler : ScriptableObject
Fields
m_Settings
Settings reference for all scalers.
Declaration
protected IAdaptivePerformanceSettings m_Settings
Field Value
Type | Description |
---|---|
IAdaptivePerformanceSettings |
Properties
CpuImpact
Scaler impact on CPU so far in milliseconds.
Declaration
public int CpuImpact { get; }
Property Value
Type | Description |
---|---|
Int32 |
CurrentLevel
Returns the current level of scale.
Declaration
public int CurrentLevel { get; }
Property Value
Type | Description |
---|---|
Int32 |
Enabled
Returns true
if this scaler is active, otherwise returns false
.
Declaration
public virtual bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
GpuImpact
Scaler impact on GPU so far in milliseconds.
Declaration
public int GpuImpact { get; }
Property Value
Type | Description |
---|---|
Int32 |
IsMaxLevel
Returns true
if the scaler can no longer be applied, otherwise returns false
.
Declaration
public bool IsMaxLevel { get; }
Property Value
Type | Description |
---|---|
Boolean |
MaxBound
Returns the maximum boundary of this scaler.
Declaration
public virtual float MaxBound { get; set; }
Property Value
Type | Description |
---|---|
Single |
MaxLevel
Returns the maximum level of this scaler.
Declaration
public virtual int MaxLevel { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
MinBound
Returns the minimum boundary of this scaler.
Declaration
public virtual float MinBound { get; set; }
Property Value
Type | Description |
---|---|
Single |
Name
Returns a string with the name of the scaler.
Declaration
public virtual string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
NotLeveled
Returns true
if the scaler is not applied, otherwise returns false
.
Declaration
public bool NotLeveled { get; }
Property Value
Type | Description |
---|---|
Boolean |
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.
Declaration
public int OverrideLevel { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Scale
Returns a generic scale of this scaler in range [0,1] which is applied to the quality.
Declaration
public virtual float Scale { get; set; }
Property Value
Type | Description |
---|---|
Single |
Target
Returns the bottlenecks that this scaler targets.
Declaration
public virtual ScalerTarget Target { get; set; }
Property Value
Type | Description |
---|---|
ScalerTarget |
VisualImpact
Returns the visual impact of scaler when applied.
Declaration
public virtual ScalerVisualImpact VisualImpact { get; set; }
Property Value
Type | Description |
---|---|
ScalerVisualImpact |
Methods
ApplyDefaultSetting(AdaptivePerformanceScalerSettingsBase)
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.
Declaration
public void ApplyDefaultSetting(AdaptivePerformanceScalerSettingsBase defaultSetting)
Parameters
Type | Name | Description |
---|---|---|
AdaptivePerformanceScalerSettingsBase | defaultSetting | The settings to apply to the scaler. |
Awake()
Ensures settings are applied during startup.
Declaration
protected virtual void Awake()
CalculateCost()
Calculate the cost of applying this particular scaler.
Declaration
public int CalculateCost()
Returns
Type | Description |
---|---|
Int32 | Cost of scaler ranges from 0 to infinity. |
OnDisabled()
Callback when scaler gets disabled and removed from indexer
Declaration
protected virtual void OnDisabled()
OnEnabled()
Callback when scaler gets enabled and added to the indexer
Declaration
protected virtual void OnEnabled()
OnLevel()
Callback for any level change
Declaration
protected virtual void OnLevel()
OnLevelDecrease()
Callback for when the performance level is decreased.
Declaration
protected virtual void OnLevelDecrease()
OnLevelIncrease()
Callback for when the performance level is increased.
Declaration
protected virtual void OnLevelIncrease()
ScaleChanged()
Checks if scale changed based on the current level and returns true if scale changed false otherwise.
Declaration
protected bool ScaleChanged()
Returns
Type | Description |
---|---|
Boolean | Returns true if scale changed false otherwise. |