Check for feature support
Verify if your device supports a specific Adaptive Performance feature.
Read time 1 minuteLast updated 20 days ago
Verify if your device supports a specific Adaptive Performance capability.
Adaptive Performance comes with different features. You can check which features a device supports using . For available provider features, refer to the enumeration.
IAdaptivePerformance.SupportedFeatureFeatureThe following example checks for the :
Feature.ClusterInfousing UnityEngine;using UnityEngine.AdaptivePerformance;using UnityEngine.AdaptivePerformance.Provider;public class AdaptivePerformanceFeatureChecker : MonoBehaviour{ // Declare 'ap' as a private class-level field to hold the IAdaptivePerformance instance. private IAdaptivePerformance ap; void Start() { // Get the Adaptive Performance instance. ap = Holder.Instance; // Check if Adaptive Performance is active. if (ap == null || !ap.Active) { Debug.Log("[AP ClusterInfo] Adaptive Performance not active."); return; } // Check if the ClusterInfo feature is supported by the active provider. if (!ap.SupportedFeature(Feature.ClusterInfo)) { Debug.Log("[AP ClusterInfo] Feature not supported."); } // Access ClusterInfo metrics if the feature is supported. var clusterInfo = ap.PerformanceStatus.PerformanceMetrics.ClusterInfo; }}