/// <summary>
 /// Returns a list of all available scaler profiles.
 /// </summary>
 /// <returns></returns>
 public string[] GetAvailableScalerProfiles()
 {
     string[] scalerNames = new string[m_scalerProfileList.Length];
     if (m_scalerProfileList.Length <= 0)
     {
         APLog.Debug("No scaler profiles available. You can not load and apply profiles. Add more profiles in the Adaptive Performance settings.");
         return(scalerNames);
     }
     for (int i = 0; i < m_scalerProfileList.Length; i++)
     {
         AdaptivePerformanceScalerProfile scalerProfile = m_scalerProfileList[i];
         scalerNames[i] = scalerProfile.Name;
     }
     return(scalerNames);
 }
        /// <summary>
        /// Load a scaler profile from the settings. Unity update the values of all scalers in the profile to new ones.
        /// This is a heavy operation using reflection and should not be used per frame and only in load operations as it causes hitching and possible screen artifacts depending on which scalers are used in a scene.
        /// </summary>
        /// <param name="scalerProfileName">Supply the name of the scaler. You can query a list of available scaler profiles via <see cref="IAdaptivePerformanceSettings.GetAvailableScalerProfiles"/>.</param>
        public void LoadScalerProfile(string scalerProfileName)
        {
            if (scalerProfileName == null || scalerProfileName.Length <= 0)
            {
                APLog.Debug("Scaler profile name empty. Can not load and apply profile.");
                return;
            }
            if (m_scalerProfileList.Length <= 0)
            {
                APLog.Debug("No scaler profiles available. Can not load and apply profile. Add more profiles in the Adaptive Performance settings.");
                return;
            }
            if (m_scalerProfileList.Length == 1)
            {
                APLog.Debug("Only default scaler profile available. Reset all scalers to default profile.");
            }

            for (int i = 0; i < m_scalerProfileList.Length; i++)
            {
                AdaptivePerformanceScalerProfile scalerProfile = m_scalerProfileList[i];
                if (scalerProfile == null)
                {
                    APLog.Debug("Scaler profile is null. Can not load and apply profile. Check Adaptive Performance settings.");
                    return;
                }
                if (scalerProfile.Name == null || scalerProfile.Name.Length <= 0)
                {
                    APLog.Debug("Scaler profile name is null or empty. Can not load and apply profile. Check Adaptive Performance settings.");
                    return;
                }
                if (scalerProfile.Name == scalerProfileName)
                {
                    scalerSettings.ApplySettings(scalerProfile);
                    break;
                }
            }
            if (ApplyScalerProfileToAllScalers())
            {
                APLog.Debug($"Scaler profile {scalerProfileName} loaded.");
            }
        }