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
- Type: Class
- Namespace: UnityEngine.AdaptivePerformance
- Assembly: UnityEngine.AdaptivePerformanceModule
public class AdaptivePerformanceIdleTimeTracker
Remarks
By default, idle detection uses the legacy Input Manager ( and ). 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.
Input.anyKeyInput.mousePositionDeltaConstructors
Constructor | Description |
|---|---|
| AdaptivePerformanceIdleTimeTracker() | Initializes a new instance of the AdaptivePerformanceIdleTimeTracker class. |
Static Properties
Property | Description |
|---|---|
| IsAnyKeyPressed | Whether any key or button (keyboard, mouse, or controller button) is currently pressed. Uses AdaptivePerformanceIdleTimeTracker.IsAnyKeyPressedProvider. |
| IsAnyKeyPressedProvider | Provider 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. |
| IsCursorMoving | Whether the pointer was active this frame (cursor movement or an active touch). Uses AdaptivePerformanceIdleTimeTracker.IsCursorMovingProvider. |
| IsCursorMovingProvider | Provider 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). |
| IsUserActive | Whether the developer-defined activity condition reports activity this frame. Uses AdaptivePerformanceIdleTimeTracker.IsUserActiveProvider. |
| IsUserActiveProvider | Optional 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. |