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.
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
)
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.
|
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\u003eIGvrEventExecutor\u003c/code\u003e provides an interface for executing events, particularly for objects implementing \u003ccode\u003eIEventSystemHandler\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods like \u003ccode\u003eExecute\u003c/code\u003e, \u003ccode\u003eExecuteHierarchy\u003c/code\u003e, and \u003ccode\u003eGetEventHandler\u003c/code\u003e to facilitate event triggering and handling within a game object hierarchy.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eExecute\u003c/code\u003e triggers an event on a specific game object, while \u003ccode\u003eExecuteHierarchy\u003c/code\u003e searches up the hierarchy for an object capable of handling the event.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGetEventHandler\u003c/code\u003e locates the game object implementing a specific event handler type within the hierarchy, traversing upwards from the given root.\u003c/p\u003e\n"]]],["The `IGvrEventExecutor` interface provides methods for executing events on game objects. `Execute\u003cT\u003e` executes an event of type `T` on a target object, applying a specified function. `ExecuteHierarchy\u003cT\u003e` recursively searches up the object hierarchy from a root, executing events until a handler is found. `GetEventHandler\u003cT\u003e` finds and returns the game object that implements the event handler interface `T`, searching upwards from a specified root object. These functions manage event handling and propagation within the game object hierarchy.\n"],null,["# IGvrEventExecutor Interface Reference\n\nIGvrEventExecutor\n=================\n\nProvides an interface for executing events for `IEventSystemHandler`.\n\nSummary\n-------\n\n### Inheritance\n\nDirect Known Subclasses:[GvrEventExecutor](/vr/reference/unity/class/GvrEventExecutor)\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [Execute\u003c T \u003e](#interfaceIGvrEventExecutor_1a06bac02a4be64828c08491307a0f434c)`(GameObject target, BaseEventData eventData, ExecuteEvents.EventFunction\u003c T \u003e functor)` | `bool` Execute the event of type `T : IEventSystemHandler` on the game object. |\n| [ExecuteHierarchy\u003c T \u003e](#interfaceIGvrEventExecutor_1a0b53810698bfe307665277bfd0bd4c46)`(GameObject root, BaseEventData eventData, ExecuteEvents.EventFunction\u003c T \u003e callbackFunction)` | `GameObject` Recurse up the hierarchy calling `Execute` until there is a game object that can handle the event. |\n| [GetEventHandler\u003c T \u003e](#interfaceIGvrEventExecutor_1a2557d6052f504e335a9c38f9e4e28d45)`(GameObject root)` | `GameObject` Traverse the object hierarchy starting at root, and return the game object which implements the event handler of type `T`. |\n\nPublic functions\n----------------\n\n### Execute\\\u003c T \\\u003e\n\n```c#\nbool Execute\u003c T \u003e(\n GameObject target,\n BaseEventData eventData,\n ExecuteEvents.EventFunction\u003c T \u003e functor\n)\n``` \nExecute the event of type `T : IEventSystemHandler` on the game object.\n\nThe event will be executed on all components on the game object that can handle it.\n\n\u003cbr /\u003e\n\n| Details ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-------------|----------------------------------------------------| | `target` | Target game object. | | `eventData` | Data associated with the executing event. | | `functor` | Function to execute on the game object components. | |\n| Template Parameters | |-----|------------------------------------------------| | `T` | An interface with methods for handling events. | |\n| **Returns** | A value indicating whether the delegate successfully executed. |\n\n### ExecuteHierarchy\\\u003c T \\\u003e\n\n```c#\nGameObject ExecuteHierarchy\u003c T \u003e(\n GameObject root,\n BaseEventData eventData,\n ExecuteEvents.EventFunction\u003c T \u003e callbackFunction\n)\n``` \nRecurse up the hierarchy calling `Execute` until there is a game object that can handle the event.\n\nSee \u003chttps://docs.unity3d.com/2017.4/Documentation/ScriptReference/EventSystems.ExecuteEvents.ExecuteHierarchy.html\u003e.\n\n\u003cbr /\u003e\n\n| Details ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------------|----------------------------------------------------| | `root` | Start game object for search. | | `eventData` | Data associated with the executing event. | | `callbackFunction` | Function to execute on the game object components. | |\n| Template Parameters | |-----|------------------------------------------------| | `T` | An interface with methods for handling events. | |\n| **Returns** | GameObject Game object that handled the event. |\n\n### GetEventHandler\\\u003c T \\\u003e\n\n```c#\nGameObject GetEventHandler\u003c T \u003e(\n GameObject root\n)\n``` \nTraverse the object hierarchy starting at root, and return the game object which implements the event handler of type `T`.\n\n**Note:**Traversal is performed upwards from the target object, not down.\n\n| Details ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------|--------------------------------------------------| | `root` | The root object to which to send event triggers. | |\n| Template Parameters | |-----|------------------------------------------------| | `T` | An interface with methods for handling events. | |\n| **Returns** | The event handler. |"]]