Events Prefab

The Events prefab object triggers your callback when an event occurs on the website. You can have multiple events for the same GenvidEvents object. You need to modify the size of the Ids to have the number of events required for your application. Each element of this array contains several properties that can be modified:

Genvid Events inspector view
Id
The name of the event. Make sure to use a unique name compared to the other events used in your application.

On Event Triggered (String eventId, EventResult[] results, Int32 size, IntPtr data)

The On Event Triggered function executes when the event triggers from the website.

  • eventId is the unique ID for the event.
  • results is a list of the possible results from the event.
  • size is the number of results available.
  • data is a unique pointer related to the specific callback.

In the Unity cube sample, we use the Events prefab to be able to react to color changes, cheering, and resets. For each event, we look at the event results to get information about the changes to apply. We then apply the changes in game and, in the case of color changes, an annotation is submitted with information about which cubes changed color.