Skip to main content

Create Your First GES Event

TinyGiants
Unity Games & Tools Developer

Create a parameterless event for a simple scene response, then use the same asset for the raiser and the callback. Trigger the raiser in Play Mode and check that the callback runs once.

Initialize the active scene​

After importing Game Event System, open Tools > TinyGiants > GES > Game Event System and click Initialize Event System. Wait for Unity to finish compiling, then check for System Initialized in the dashboard and GameEventManager in the Hierarchy.

Initialized dashboard

Create and raise the event​

  1. Open Game Event Editor from the dashboard, select a database, and click + New Event
  2. In Game Event Creator, select Parameterless, click Add Event, name the row OnButtonPressed, and click Create 1 Event(s)
  3. On a UI Button's GameObject, add GameEvent Raiser, then select OnButtonPressed in its event field
  4. In the Button's On Click () list, add the Raiser component as a target and select GameEventRaiser > Raise

Creator configured for a parameterless event

Bind a response and test it​

Add the following component to a scene object that will receive the event.

using UnityEngine;

public class ButtonResponder : MonoBehaviour
{
public void RespondToButton()
{
Debug.Log("OnButtonPressed received");
}
}

Open Game Event Behavior for OnButtonPressed from Game Event Editor. Add an item under Event Action, assign the object, and select ButtonResponder > RespondToButton.

Target and method selection in the Event Action list

In Play Mode, click the button once and check for one OnButtonPressed received entry in the Console. If the button fires and the response is missing, check the event selected on the Raiser and the object and method assigned under Event Action. To add a sound response, bind an AudioSource.Play callback in the same action list and click the button again.

Run the quick-start demo · Pass typed data in an event