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.
GvrDaydreamApi
Main entry point Daydream specific APIs.
Summary
This class automatically instantiates an instance when this API is used for the first time. For explicit control over when the instance is created and the Java references are setup call the provided CreateAsync
method, for example when no UI is being displayed to the user.
Inheritance
Inherits from: IDisposable
Public static functions
|
Create()
|
void
Deprecated.
Create() without arguments is deprecated. Use CreateAsync(callback) instead. Creates a generic asynchronous callback. |
CreateAsync(Action< bool > callback)
|
void
Asynchronously instantiates a GvrDayreamApi .
|
LaunchVrHome()
|
void
Deprecated.
Use LaunchVrHomeAsync(callback) instead. Launches a generic asynchronous VR Home call. |
LaunchVrHomeAsync(Action< bool > callback)
|
void
Asynchronously launches VR Home.
|
Properties
IsCreated
static bool IsCreated
Public static functions
Create
void Create()
Creates a generic asynchronous callback.
Deprecated.
Create() without arguments is deprecated. Use CreateAsync(callback) instead.
CreateAsync
void CreateAsync(
Action< bool > callback
)
Asynchronously instantiates a GvrDayreamApi
.
The provided callback will be called with a bool argument indicating whether instance creation was successful.
LaunchVrHome
void LaunchVrHome()
Launches a generic asynchronous VR Home call.
Deprecated.
Use LaunchVrHomeAsync(callback)
instead.
LaunchVrHomeAsync
void LaunchVrHomeAsync(
Action< bool > callback
)
Asynchronously launches VR Home.
Instantiates an instance of GvrDaydreamApi if necessary. If successful, launches VR Home.
The provided callback will be called with a bool argument indicating whether instance creation and launch of VR Home was successful.
Details |
Parameters |
callback
|
A callback to make after launching the VrHome screen.
|
|
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."],[[["\u003cp\u003e\u003ccode\u003eGvrDaydreamApi\u003c/code\u003e serves as the primary entry point for Daydream-specific APIs within Unity and automatically instantiates upon first use.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize \u003ccode\u003eCreateAsync\u003c/code\u003e for explicit control over instance creation timing, which is recommended for scenarios like UI-less operations.\u003c/p\u003e\n"],["\u003cp\u003eTo launch the VR Home environment, developers can use \u003ccode\u003eLaunchVrHomeAsync\u003c/code\u003e, providing a callback for handling launch success or failure.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIsCreated\u003c/code\u003e property provides a status check to determine if the \u003ccode\u003eGvrDaydreamApi\u003c/code\u003e instance has already been created.\u003c/p\u003e\n"]]],["The `GvrDaydreamApi` class provides Daydream-specific APIs, automatically instantiating upon first use. For explicit control, `CreateAsync` instantiates the API asynchronously, with a callback indicating success. `IsCreated` checks if the API is instantiated. `LaunchVrHomeAsync` launches VR Home asynchronously, also using a success-indicating callback, and automatically instantiates the API if needed. `Create` and `LaunchVrHome` are deprecated.\n"],null,["# GvrDaydreamApi Class Reference\n\nGvrDaydreamApi\n==============\n\nMain entry point Daydream specific APIs.\n\nSummary\n-------\n\nThis class automatically instantiates an instance when this API is used for the first time. For explicit control over when the instance is created and the Java references are setup call the provided `CreateAsync` method, for example when no UI is being displayed to the user.\n\n### Inheritance\n\nInherits from: IDisposable\n\n| ### Properties ||\n|----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [IsCreated](#classGvrDaydreamApi_1aab4181c99b9032f727a02b8e22047ffc) | `static bool` Gets a value indicating whether the [GvrDaydreamApi](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi) has been created. |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Create](#classGvrDaydreamApi_1ad3ec4a16354965150d224ff2b976db61)`()` | `void` **[Deprecated.](/vr/reference/unity/deprecated/deprecated)** [Create()](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi_1ad3ec4a16354965150d224ff2b976db61) without arguments is deprecated. Use CreateAsync(callback) instead. Creates a generic asynchronous callback. |\n| [CreateAsync](#classGvrDaydreamApi_1a469b527821bd0ea89ca29ccee3f1d8a0)`(Action\u003c bool \u003e callback)` | `void` Asynchronously instantiates a `GvrDayreamApi`. |\n| [LaunchVrHome](#classGvrDaydreamApi_1a1a3e78c09b21b8b84aa403e8e87cf417)`()` | `void` **[Deprecated.](/vr/reference/unity/deprecated/deprecated)** Use `LaunchVrHomeAsync(callback)` instead. Launches a generic asynchronous VR Home call. |\n| [LaunchVrHomeAsync](#classGvrDaydreamApi_1a13e268334596e00970f87cc6f75ceec3)`(Action\u003c bool \u003e callback)` | `void` Asynchronously launches VR Home. |\n\nProperties\n----------\n\n### IsCreated\n\n```c#\nstatic bool IsCreated\n``` \nGets a value indicating whether the [GvrDaydreamApi](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi) has been created.\n\nValue `true` if the [GvrDaydreamApi](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi) has been created, `false` otherwise.\n\nPublic static functions\n-----------------------\n\n### Create\n\n```c#\nvoid Create()\n``` \nCreates a generic asynchronous callback.\n\n**[Deprecated.](/vr/reference/unity/deprecated/deprecated)** [Create()](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi_1ad3ec4a16354965150d224ff2b976db61) without arguments is deprecated. Use CreateAsync(callback) instead. \n\n### CreateAsync\n\n```c#\nvoid CreateAsync(\n Action\u003c bool \u003e callback\n)\n``` \nAsynchronously instantiates a `GvrDayreamApi`.\n\nThe provided callback will be called with a bool argument indicating whether instance creation was successful.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|---------------------------------------------------------------------------------------------------------------------| | `callback` | A callback to make after creating a [GvrDaydreamApi](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi). | |\n\n### LaunchVrHome\n\n```c#\nvoid LaunchVrHome()\n``` \nLaunches a generic asynchronous VR Home call.\n\n**[Deprecated.](/vr/reference/unity/deprecated/deprecated)** Use `LaunchVrHomeAsync(callback)` instead. \n\n### LaunchVrHomeAsync\n\n```c#\nvoid LaunchVrHomeAsync(\n Action\u003c bool \u003e callback\n)\n``` \nAsynchronously launches VR Home.\n\nInstantiates an instance of [GvrDaydreamApi](/vr/reference/unity/class/GvrDaydreamApi#classGvrDaydreamApi) if necessary. If successful, launches VR Home.\n\nThe provided callback will be called with a bool argument indicating whether instance creation and launch of VR Home was successful.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------|-------------------------------------------------------| | `callback` | A callback to make after launching the VrHome screen. | |"]]