November 6, 2019 update:
  • There's a new open source Cardboard SDK for iOS and Android NDK that offers a streamlined API, improved device compatibility, and built-in viewer profile QR code scanning. A corresponding Unity package (SDK) is planned for a future release. We recommend that all developers actively building for Google Cardboard migrate (iOS, Android NDK) to the new Cardboard SDK.
October 15, 2019 update:
  • The Daydream View VR headset is no longer available for purchase. However, you can continue to use the existing Google VR SDK to update and distribute your apps to the Google Play Store, and make them available to users in the Daydream app.

IGvrEventExecutor

Provides an interface for executing events for IEventSystemHandler.

Summary

Inheritance

Direct Known Subclasses:GvrEventExecutor

Public functions

Execute< T >(GameObject target, BaseEventData eventData, ExecuteEvents.EventFunction< T > functor)
bool
Execute the event of type T : IEventSystemHandler on the game object.
ExecuteHierarchy< T >(GameObject root, BaseEventData eventData, ExecuteEvents.EventFunction< T > callbackFunction)
GameObject
Recurse up the hierarchy calling Execute until there is a game object that can handle the event.
GetEventHandler< T >(GameObject root)
GameObject
Traverse the object hierarchy starting at root, and return the game object which implements the event handler of type T.

Public functions

Execute< T >

bool Execute< T >(
  GameObject target,
  BaseEventData eventData,
  ExecuteEvents.EventFunction< T > functor
)

Execute the event of type T : IEventSystemHandler on the game object.

The event will be executed on all components on the game object that can handle it.

Details
Parameters
target
Target game object.
eventData
Data associated with the executing event.
functor
Function to execute on the game object components.
Template Parameters
T
An interface with methods for handling events.
Returns
A value indicating whether the delegate successfully executed.

ExecuteHierarchy< T >

GameObject ExecuteHierarchy< T >(
  GameObject root,
  BaseEventData eventData,
  ExecuteEvents.EventFunction< T > callbackFunction
)

Recurse up the hierarchy calling Execute until there is a game object that can handle the event.

See https://docs.unity3d.com/2017.4/Documentation/ScriptReference/EventSystems.ExecuteEvents.ExecuteHierarchy.html.

Details
Parameters
root
Start game object for search.
eventData
Data associated with the executing event.
callbackFunction
Function to execute on the game object components.
Template Parameters
T
An interface with methods for handling events.
Returns
GameObject Game object that handled the event.

GetEventHandler< T >

GameObject GetEventHandler< T >(
  GameObject root
)

Traverse the object hierarchy starting at root, and return the game object which implements the event handler of type T.

Note:Traversal is performed upwards from the target object, not down.

Details
Parameters
root
The root object to which to send event triggers.
Template Parameters
T
An interface with methods for handling events.
Returns
The event handler.