XRBatteryStateDisplayFeature

This XRBatteryStateDisplayFeature provides a function to query the battery state of input devices.

Summary

Inheritance

Inherits from: OpenXRFeature

Public attributes

ExtensionString = "XR_EXT_interaction_profile_battery_state_display"
const string
The OpenXR Extension string.
FeatureId = "com.google.xr.extensions.battery_state_display"
const string
The feature ID string.
UiName = "Battery State Display"
const string
The UI name shows on the XR Plug-in Management panel, to help users understand validation errors and expected fixes.

Public static attributes

IsExtensionEnabled => _extensionEnabled
bool
Gets if the required OpenXR extension is enabled.

Public static functions

TryGetBatteryStateDisplay(string topLevelUserPath, out BatteryStatus status, out float level)
bool
Gets the battery state for a given top level user input path.

Public attributes

ExtensionString

const string ExtensionString = "XR_EXT_interaction_profile_battery_state_display"

The OpenXR Extension string.

Used to check if this extension is available or enabled.

FeatureId

const string FeatureId = "com.google.xr.extensions.battery_state_display"

The feature ID string.

UiName

const string UiName = "Battery State Display"

The UI name shows on the XR Plug-in Management panel, to help users understand validation errors and expected fixes.

Public static attributes

IsExtensionEnabled

bool IsExtensionEnabled => _extensionEnabled

Gets if the required OpenXR extension is enabled.

When OpenXR runtime is waiting, it returns null. Otherwise, it indicates whether the XR_EXT_interaction_profile_battery_state_display extension is available on the current device.

Public static functions

TryGetBatteryStateDisplay

bool TryGetBatteryStateDisplay(
  string topLevelUserPath,
  out BatteryStatus status,
  out float level
)

Gets the battery state for a given top level user input path.

Details
Parameters
topLevelUserPath
Top level user input path from OpenXRInteractionFeature.UserPaths.
batteryStatus
Battery state information.