Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AdaptivePerformanceIdleTimeTracker

Tracks how long the player has been idle so battery mode can reduce quality further during inactivity.
Read time 1 minuteLast updated 6 days ago

Definition

public class AdaptivePerformanceIdleTimeTracker

Remarks

By default, idle detection uses the legacy Input Manager (
Input.anyKey
and
Input.mousePositionDelta
). If the legacy Input Manager is disabled, idle detection stops and battery mode's idle-based scaling becomes inactive. To re-enable it, assign AdaptivePerformanceIdleTimeTracker.IsAnyKeyPressedProvider and AdaptivePerformanceIdleTimeTracker.IsCursorMovingProvider with implementations backed by your input system, such as the Input System package.

Constructors

Constructor

Description

AdaptivePerformanceIdleTimeTracker()Initializes a new instance of the AdaptivePerformanceIdleTimeTracker class.

Static Properties

Property

Description

IsAnyKeyPressedWhether any key or button (keyboard, mouse, or controller button) is currently pressed. Uses AdaptivePerformanceIdleTimeTracker.IsAnyKeyPressedProvider.
IsAnyKeyPressedProviderProvider used to determine if any key or button is pressed. The default (legacy Input.anyKey) covers keyboard keys, mouse buttons, and controller buttons. Controller analog sticks and triggers are project-defined and not detected by the default; assign a custom provider (for example, backed by the Input System) to include them.
IsCursorMovingWhether the pointer was active this frame (cursor movement or an active touch). Uses AdaptivePerformanceIdleTimeTracker.IsCursorMovingProvider.
IsCursorMovingProviderProvider used to determine if the pointer was active this frame (cursor movement or an active touch). Assign to override the default (legacy Input.mousePositionDelta and Input.touchCount).
IsUserActiveWhether the developer-defined activity condition reports activity this frame. Uses AdaptivePerformanceIdleTimeTracker.IsUserActiveProvider.
IsUserActiveProviderOptional developer-defined activity condition, checked in addition to key and cursor input. Return true to signal user activity from a source not covered by the built-in checks (for example, gamepad analog sticks via the Input System, or application-specific activity). Defaults to a condition that reports no activity.