This site has been permanently archived. The content on this site was last updated in 2019.
GvrXREventsSubscriber
Handler for subscribing XR Unity actions to GVR Actions.
Summary
Inheritance
Inherits from: MonoBehaviour
Properties
|
loadedDeviceName
|
static string
Gets the name of the loaded GVR device.
|
Properties
loadedDeviceName
static string loadedDeviceName
Gets the name of the loaded GVR device.
This should be used in place of XRSettings.loadedDeviceName
, which allocates small amounts of memory on every call.
When using 2018.3 and above, a cached copy of XRSettings.loadedDeviceName
which updates whenever the OnDeviceLoadAction
event triggers.
On 2018.2 and below, a one-time snapshot of the initial XRSettings.loadedDeviceName
taken when this component is instantiated. If loadedDeviceName
is expected to change during runtime in 2018.2 or earlier, use the setter to assign XRSettings.loadedDeviceName
when this is expected to happen.
The name of the loaded GVR device.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[null,null,["Last updated 2024-10-09 UTC."],[[["GvrXREventsSubscriber handles subscribing XR Unity actions to Google VR (GVR) actions."],["Provides a `loadedDeviceName` property to efficiently get the name of the loaded GVR device, minimizing memory allocation compared to using `XRSettings.loadedDeviceName` directly."],["The `loadedDeviceName` property behaves differently across Unity versions: in 2018.3 and above, it's dynamically updated; in 2018.2 and below, it's a one-time snapshot that can be manually updated using the setter if needed."]]],["The `GvrXREventsSubscriber` component handles subscribing XR Unity actions to GVR Actions. It provides a static property, `loadedDeviceName`, to retrieve the name of the loaded GVR device. This property caches `XRSettings.loadedDeviceName` to avoid memory allocation. In Unity 2018.3+, it updates with the `OnDeviceLoadAction` event. In earlier versions, it captures a one-time snapshot upon instantiation, but allows setting `XRSettings.loadedDeviceName` if changes are anticipated.\n"]]