This site has been permanently archived. The content on this site was last updated in 2019.
Stay organized with collections
Save and categorize content based on your preferences.
GvrSettings
Accesses and configures Daydream settings.
Summary
Public attributes
|
VR_SDK_CARDBOARD = "cardboard"
|
const string
Name of Cardboard GVR SDK, as returned by VRSettings.loadedDeviceName.
|
VR_SDK_DAYDREAM = "daydream"
|
const string
Name of Daydream GVR SDK, as returned by VRSettings.loadedDeviceName .
|
VR_SDK_NONE = "None"
|
const string
Name of 'None' VR SDK, as returned by VRSettings.loadedDeviceName .
|
Public types
UserPrefsHandedness
UserPrefsHandedness
Handedness preference values.
Properties |
Error
|
An error value indicating that something has gone wrong.
Plugin-only value, does not exist in the NDK.
|
Left
|
A left-handed preference.
|
Right
|
A right-handed preference.
|
ViewerPlatformType
Viewer type.
Properties |
Cardboard
|
The Google Cardboard platform.
|
Daydream
|
The Google Daydream platform.
|
Error
|
An error value indicating that something has gone wrong.
Plugin-only value, does not exist in the NDK.
|
Public attributes
VR_SDK_CARDBOARD
const string VR_SDK_CARDBOARD = "cardboard"
Name of Cardboard GVR SDK, as returned by VRSettings.loadedDeviceName.
VR_SDK_DAYDREAM
const string VR_SDK_DAYDREAM = "daydream"
Name of Daydream GVR SDK, as returned by VRSettings.loadedDeviceName
.
VR_SDK_NONE
const string VR_SDK_NONE = "None"
Name of 'None' VR SDK, as returned by VRSettings.loadedDeviceName
.
Properties
Handedness
static UserPrefsHandedness Handedness
Gets the user's handedness preference value.
The user's handedness preference value.
static bool SustainedPerformanceMode
Sets a value indicating whether sustained performance mode is enabled.
The developer is expected to remember whether sustained performance mode is set at runtime, via the checkbox in Player Settings.
This state may be recorded here in a future release.
The sustained performance mode setting.
static ViewerPlatformType ViewerPlatform
Gets the viewer platform type setting.
In the editor this can be set for devlopment testing.
The viewer platform type setting.
Public static functions
GetValidGvrNativePtrOrLogError
IntPtr GetValidGvrNativePtrOrLogError()
Wraps call to VRDevice.GetNativePtr()
.
Logs error if a supported GVR SDK is not active or if the returned native pointer is IntPtr.Zero
.
Details |
Returns
|
An int pointer representing a GVR context.
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003e\u003ccode\u003eGvrSettings\u003c/code\u003e provides access and configuration options for Daydream and Cardboard settings within Unity VR development.\u003c/p\u003e\n"],["\u003cp\u003eIt allows developers to retrieve user preferences like handedness and the active viewer platform (Cardboard or Daydream).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGvrSettings\u003c/code\u003e exposes properties to control sustained performance mode and obtain native GVR context pointers.\u003c/p\u003e\n"],["\u003cp\u003eIt offers public attributes representing the names of Cardboard, Daydream, and None VR SDKs for runtime checks.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize \u003ccode\u003eGvrSettings\u003c/code\u003e to tailor VR experiences based on user preferences and the detected VR platform.\u003c/p\u003e\n"]]],["GvrSettings manages Daydream settings, offering access to user preferences and configurations. Key actions include: retrieving the user's handedness preference (left, right, or error), setting sustained performance mode, and determining the viewer platform type (Cardboard, Daydream, or error). It also provides names for different VR SDKs (Cardboard, Daydream, None) and a function to get a GVR context pointer.\n"],null,["# GvrSettings Class Reference\n\nGvrSettings\n===========\n\nAccesses and configures Daydream settings.\n\nSummary\n-------\n\n| ### Public types ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|\n| [UserPrefsHandedness](#classGvrSettings_1a7617cae1ca9bf5987d89957a3c47d7c4)`{` ` `[Error](#classGvrSettings_1a7617cae1ca9bf5987d89957a3c47d7c4a902b0d55fddef6f8d651fe1035b7d4bd)` = -1,` ` `[Right](#classGvrSettings_1a7617cae1ca9bf5987d89957a3c47d7c4a92b09c7c48c520c3c55e497875da437c)`,` ` `[Left](#classGvrSettings_1a7617cae1ca9bf5987d89957a3c47d7c4a945d5e233cf7d6240f6b783b36a374ff) `}` | enum Handedness preference values. |\n| [ViewerPlatformType](#classGvrSettings_1afedeb28afa253f4be96799f56b31ab87)`{` ` `[Error](#classGvrSettings_1afedeb28afa253f4be96799f56b31ab87a902b0d55fddef6f8d651fe1035b7d4bd)` = -1,` ` `[Cardboard](#classGvrSettings_1afedeb28afa253f4be96799f56b31ab87ade4657520f74a9de815899b7d026654e)`,` ` `[Daydream](#classGvrSettings_1afedeb28afa253f4be96799f56b31ab87a98213f5932cb96ff4fe7f85c449d06dd) `}` | enum Viewer type. |\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| [VR_SDK_CARDBOARD](#classGvrSettings_1a1ee97f4f8627dffa5771e31b06f2ea13)` = \"cardboard\"` | `const string` Name of Cardboard GVR SDK, as returned by VRSettings.loadedDeviceName. |\n| [VR_SDK_DAYDREAM](#classGvrSettings_1a19b6c9c620ac914d36c7982ca117ed9a)` = \"daydream\"` | `const string` Name of Daydream GVR SDK, as returned by `VRSettings.loadedDeviceName`. |\n| [VR_SDK_NONE](#classGvrSettings_1ab17ee8ef963c3691647b6b8d87182359)` = \"None\"` | `const string` Name of 'None' VR SDK, as returned by `VRSettings.loadedDeviceName`. |\n\n| ### Properties ||\n|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Handedness](#classGvrSettings_1a1f7bdc1367c1952244497801816884e7) | `static `[UserPrefsHandedness](/vr/reference/unity/class/GvrSettings#classGvrSettings_1a7617cae1ca9bf5987d89957a3c47d7c4) Gets the user's handedness preference value. |\n| [SustainedPerformanceMode](#classGvrSettings_1ae698f9ce1a55ce892023968871d1425f) | `static bool` Sets a value indicating whether sustained performance mode is enabled. |\n| [ViewerPlatform](#classGvrSettings_1a1ace5d2aca4019e5526ba55e9d877b12) | `static `[ViewerPlatformType](/vr/reference/unity/class/GvrSettings#classGvrSettings_1afedeb28afa253f4be96799f56b31ab87) Gets the viewer platform type setting. |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [GetValidGvrNativePtrOrLogError](#classGvrSettings_1ae918c8d7811dba77da84ff86d3afa13f)`()` | `IntPtr` Wraps call to `VRDevice.GetNativePtr()`. |\n\nPublic types\n------------\n\n### UserPrefsHandedness\n\n```c#\n UserPrefsHandedness\n``` \nHandedness preference values.\n\n| Properties ||\n|---------|--------------------------------------------------------------------------------------------------------|\n| `Error` | An error value indicating that something has gone wrong. Plugin-only value, does not exist in the NDK. |\n| `Left` | A left-handed preference. |\n| `Right` | A right-handed preference. |\n\n### ViewerPlatformType\n\n```c#\n ViewerPlatformType\n``` \nViewer type.\n\n| Properties ||\n|-------------|--------------------------------------------------------------------------------------------------------|\n| `Cardboard` | The Google Cardboard platform. |\n| `Daydream` | The Google Daydream platform. |\n| `Error` | An error value indicating that something has gone wrong. Plugin-only value, does not exist in the NDK. |\n\nPublic attributes\n-----------------\n\n### VR_SDK_CARDBOARD\n\n```c#\nconst string VR_SDK_CARDBOARD = \"cardboard\"\n``` \nName of Cardboard GVR SDK, as returned by VRSettings.loadedDeviceName. \n\n### VR_SDK_DAYDREAM\n\n```c#\nconst string VR_SDK_DAYDREAM = \"daydream\"\n``` \nName of Daydream GVR SDK, as returned by `VRSettings.loadedDeviceName`. \n\n### VR_SDK_NONE\n\n```c#\nconst string VR_SDK_NONE = \"None\"\n``` \nName of 'None' VR SDK, as returned by `VRSettings.loadedDeviceName`.\n\nProperties\n----------\n\n### Handedness\n\n```c#\nstatic UserPrefsHandedness Handedness\n``` \nGets the user's handedness preference value.\n\nThe user's handedness preference value. \n\n### SustainedPerformanceMode\n\n```c#\nstatic bool SustainedPerformanceMode\n``` \nSets a value indicating whether sustained performance mode is enabled.\n\nThe developer is expected to remember whether sustained performance mode is set at runtime, via the checkbox in Player Settings.\n\nThis state may be recorded here in a future release.\n\nThe sustained performance mode setting. \n\n### ViewerPlatform\n\n```c#\nstatic ViewerPlatformType ViewerPlatform\n``` \nGets the viewer platform type setting.\n\nIn the editor this can be set for devlopment testing.\n\nThe viewer platform type setting.\n\nPublic static functions\n-----------------------\n\n### GetValidGvrNativePtrOrLogError\n\n```c#\nIntPtr GetValidGvrNativePtrOrLogError()\n``` \nWraps call to `VRDevice.GetNativePtr()`.\n\nLogs error if a supported GVR SDK is not active or if the returned native pointer is `IntPtr.Zero`.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|--------------------------------------------|\n| **Returns** | An int pointer representing a GVR context. |"]]