Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Deinitialize()

Stops Adaptive Performance and cleans up all associated resources and objects.
Read time 1 minuteLast updated 6 days ago

Definition

public static void Deinitialize()

Remarks

Use this method to perform a complete shutdown of the Adaptive Performance system. This method first stops any running Adaptive Performance operations by calling IAdaptivePerformance.DeinitializeAdaptivePerformance. It then cleans up the provider infrastructure and sets Holder.Instance to null.
After this method completes successfully, all Adaptive Performance functionality is unavailable until Holder.Initialize is called again.
It's safe to call this method even if Adaptive Performance isn't currently initialized.

Examples

using UnityEngine;using UnityEngine.AdaptivePerformance;public class AdaptivePerformanceManager : MonoBehaviour{ void OnApplicationPause(bool pauseStatus) { if (pauseStatus) { // Adaptive Performance state before deinitialization. Debug.Log($"Adaptive Performance initialized: {Holder.Instance.Initialized}"); // Clean up Adaptive Performance when app is paused. Holder.Deinitialize(); Debug.Log("Adaptive Performance deinitialized"); // Adaptive Performance state after deinitialization. Debug.Log($"Adaptive Performance initialized: {Holder.Instance!=null && Holder.Instance.Initialized}"); } }}