namespace UnityEngine.AdaptivePerformance
{
///
/// A scaler used by to adjust the level of antialiasing.
///
public class AdaptiveMSAA : AdaptivePerformanceScaler
{
int m_DefaultAA;
///
/// Ensures settings are applied during startup.
///
protected override void Awake()
{
base.Awake();
if (m_Settings == null)
return;
ApplyDefaultSetting(m_Settings.scalerSettings.AdaptiveMSAA);
}
///
/// Callback when scaler gets disabled and removed from indexer
///
protected override void OnDisabled()
{
AdaptivePerformanceRenderSettings.AntiAliasingQualityBias = m_DefaultAA;
}
///
/// Callback when scaler gets enabled and added to the indexer
///
protected override void OnEnabled()
{
m_DefaultAA = AdaptivePerformanceRenderSettings.AntiAliasingQualityBias;
}
///
/// Callback for any level change.
///
protected override void OnLevel()
{
if (ScaleChanged())
AdaptivePerformanceRenderSettings.AntiAliasingQualityBias = (int)(2 * Scale);
}
}
}