# GvrEventExecutor Class Reference

# GvrEventExecutor

Wraps `UnityEngine.EventSystems.ExecuteEvents`.

## Summary

Also, exposes event delegates to allow global handling of events.

### Inheritance

Inherits from: [IGvrEventExecutor](https://developers.google.com/vr/reference/unity/interface/IGvrEventExecutor)

| ### Constructors and Destructors ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1ac9140a088ae1058e837e0f59d9dfa2d0()` Initializes a new instance of the [GvrEventExecutor](https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor) class. ||

| ### Properties ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a855f3885b163b70d0cf967dac35049da` | `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc` Adds or removes delegate functions for the `OnPointerClick` event. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1ae2b6c5f0fcd61a1305e625d0516a20bb` | `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc` Adds or removes delegate functions for the `OnPointerDown` event. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a32ce494df57696a915554bb5a415adc8` | `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc` Adds or removes delegate functions for the `OnPointerEnter` event. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a888f4096ed54e7dc927d85e9c57ef3ee` | `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc` Adds or removes delegate functions for the `OnPointerExit` event. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a023ad00abd4334d6b77613cc894701bb` | `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc` Adds or removes delegate functions for the `OnPointerUp` event. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a3d7106cf163da7ca35b81dce10d92d5a` | `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc` Adds or removes delegate functions for the `OnScroll` event. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a5200a8b8695f29a710b663478477fffc(GameObject target, PointerEventData eventData)` | `delegate void` Delegate type for handling pointer events. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a45a3fd429f105268afd3dc659e1017bc(GameObject target, BaseEventData eventData, ExecuteEvents.EventFunction< T > functor)` | `bool` Execute the specified target, eventData and functor. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a59fdc0daa556293a26ff41c0181a1168(GameObject root, BaseEventData eventData, ExecuteEvents.EventFunction< T > callbackFunction)` | `GameObject` Executes the hierarchy. |
| `https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor_1a56c86421eb3a1d4dfa8874214282d423(GameObject root)` | `GameObject` Gets the event handler. |

## Properties

### OnPointerClick

```c#
EventDelegate OnPointerClick
```
Adds or removes delegate functions for the `OnPointerClick` event.

### OnPointerDown

```c#
EventDelegate OnPointerDown
```
Adds or removes delegate functions for the `OnPointerDown` event.

### OnPointerEnter

```c#
EventDelegate OnPointerEnter
```
Adds or removes delegate functions for the `OnPointerEnter` event.

### OnPointerExit

```c#
EventDelegate OnPointerExit
```
Adds or removes delegate functions for the `OnPointerExit` event.

### OnPointerUp

```c#
EventDelegate OnPointerUp
```
Adds or removes delegate functions for the `OnPointerUp` event.

### OnScroll

```c#
EventDelegate OnScroll
```
Adds or removes delegate functions for the `OnScroll` event.

## Public functions

### EventDelegate

```c#
delegate void EventDelegate(
  GameObject target,
  PointerEventData eventData
)
```
Delegate type for handling pointer events.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `target` | The GameObject to add this behavior to. | | `eventData` | The context data of the Event which triggered this call. | |

### Execute\< T \>

```c#
bool Execute< T >(
  GameObject target,
  BaseEventData eventData,
  ExecuteEvents.EventFunction< T > functor
)
```
Execute the specified target, eventData and functor.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `target` | The `GameObject` to execute this event behavior on. | | `eventData` | The triggering EventData. | | `functor` | The delegate call's implementation. | |
| Template Parameters | |---|---| | `T` | The 1st type parameter. | |
| **Returns** | Returns `true` if the method successfully executes, `false` otherwise. |

### ExecuteHierarchy\< T \>

```c#
GameObject ExecuteHierarchy< T >(
  GameObject root,
  BaseEventData eventData,
  ExecuteEvents.EventFunction< T > callbackFunction
)
```
Executes the hierarchy.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `root` | The top-level object this event should trigger. | | `eventData` | The triggering EventData. | | `callbackFunction` | Callback function. | |
| Template Parameters | |---|---| | `T` | The 1st type parameter. | |
| **Returns** | The hierarchy. |

### GetEventHandler\< T \>

```c#
GameObject GetEventHandler< T >(
  GameObject root
)
```
Gets the event handler.

<br />

| Details ||
|---|---|
| Parameters | |---|---| | `root` | The top-level object this event should trigger. | |
| Template Parameters | |---|---| | `T` | The 1st type parameter. | |
| **Returns** | The event handler. |

### GvrEventExecutor

```c#
 GvrEventExecutor()
```
Initializes a new instance of the [GvrEventExecutor](https://developers.google.com/vr/reference/unity/class/GvrEventExecutor#classGvrEventExecutor) class.