Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

AdaptivePerformanceIdleTimeTracker

class in UnityEngine.AdaptivePerformance

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Tracks how long the player has been idle so battery mode can reduce quality further during inactivity.

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.

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.

Constructors

Constructor Description
AdaptivePerformanceIdleTimeTracker Initializes a new instance of the AdaptivePerformanceIdleTimeTracker class.