ドキュメント

Unity Engine

Unity Engine

Holder

Global access to the default Adaptive Performance interface and lifecycle management controls.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public static class Holder

Remarks

The
Holder
class provides a singleton pattern for accessing Adaptive Performance functionality. Use this class to manually control the Adaptive Performance lifecycle. You can also use it to access the main interface when Initialize Adaptive Performance on Startup is disabled in the Adaptive Performance settings.
The Holder.Instance property becomes available after successful initialization and remains available until deinitialization completes.
The following example shows how to manually initialize Adaptive Performance and access thermal status.

Examples

using UnityEngine;using UnityEngine.AdaptivePerformance;public class AdaptivePerformanceExample : MonoBehaviour{ void Start() { // Initialize Adaptive Performance manually if Adaptive Performance isn't already initialized. if (Holder.Instance == null) { Holder.Initialize(); } // Access thermal status after initialization. IAdaptivePerformance adaptivePerformance = Holder.Instance; if (adaptivePerformance != null && adaptivePerformance.Initialized) { IThermalStatus thermalStatus = adaptivePerformance.ThermalStatus; // The TemperatureLevel is located inside the ThermalMetrics struct. float currentTemperature = thermalStatus.ThermalMetrics.TemperatureLevel; Debug.Log($"Temperature level: {currentTemperature}"); } }}

Static Properties

Property

Description

InstanceThe default Adaptive Performance interface instance for accessing all Adaptive Performance functionality.

Static Methods

Method

Description

DeinitializeStops Adaptive Performance and cleans up all associated resources and objects.
InitializeInitializes Adaptive Performance and makes the instance available for use.

Static Events

Member

Description

LifecycleEventHandlerOccurs when the Adaptive Performance instance is created or destroyed during lifecycle changes.