Genvid Events Listener

The GenvidEventsListener prefab defines which Events you want your game to listen to. You need to modify the size of the Listeners member to have the number of events required for your application. Each element of this array refers to a GenvidEventParameters asset.

Event

A GenvidEventParameters asset you have created by using the contextual menu.

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

On Event Triggered (String eventId, EventResult[] results, Int32 size, IntPtr data)
  • 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 Listener prefab 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, submit an annotation with information about which cubes changed color.