Skip to main content

Configure Event Actions in Game Event Behavior

TinyGiants
Unity Games & Tools Developer

A damage event can drive UI, audio, and effects through separate callbacks. Open Game Event Behavior to configure its action list, condition, and schedule. A Receiver Inspector can use its own Action Condition in GES 2.3.0 when that receiver needs a separate rule.

Open Game Event Behavior​

Select the damage event in Game Event Editor and click its Behavior button. The window contains Action Condition, Event Action, and Schedule Configuration.

Game Event Behavior with event information, conditions, actions, and scheduling

Confirm the event signature​

Check the event name, argument type, and database in Event Information. The target method's dynamic parameters must match the event signature.

Event Information showing the selected event's name, type, and database

Create OnDamageReceived with a float argument and assign the generated event asset to this component. Call PublishDamage after your damage calculation completes.

using TinyGiants.GES.Runtime;
using UnityEngine;

public sealed class DamageEmitter : MonoBehaviour
{
[GameEventDropdown, SerializeField]
private GameEvent<float> onDamageReceived;

public void PublishDamage(float amount)
{
if (onDamageReceived != null)
onDamageReceived.Raise(amount);
}
}

Gate an action​

When the entire Event Action list shares a condition, turn on Enable Conditions under Action Condition. Add a comparison with Event Argument on the left, a Constant of 50 on the right, and the > operator.

Action Condition with the enable toggle and condition tree

This condition gates the manager's action list. To show the damage number on every hit and shake the camera only on heavy hits, turn off Enable Conditions in the event window. Bind the shake and set its threshold in a typed Receiver.

Bind Event Action​

Add an Event Action entry, drag a scene object into its object field, and select a method.

Event Action with fields for a target object and method

For dynamic calls, match the parameter order to the event signature.

Event signatureExample method
No argumentsFlashRed()
floatShowNumber(float amount)
GameObject sender and float argumentHandleHit(GameObject sender, float amount)

Select ShowNumber(float) in the dynamic section of the method menu to pass the damage value through to the callback.

Adding an Event Action and selecting a method on the target

Configure scheduling​

Action Delay, Repeat Interval, and Repeat Count control the event's dispatch. Bind a delayed sound to a separate event if the damage display should update immediately.

Schedule Configuration showing delay, repeat interval, and repeat count

For a one-shot sound, set Action Delay to 0.03 and Repeat Interval to 0. To dispatch a separate bleed event three times, set Repeat Interval to 2 and Repeat Count to 3.

Raising the same event again cancels its pending automatic dispatch. Let each runtime effect own its timing when overlapping effects need to run independently.

Verify the damage response in Play Mode​

  1. Raise the damage event with 30. Confirm the damage number and screen flash appear while the camera Receiver stays quiet.
  2. Raise the event with 80. Confirm that the camera shake and the regular feedback both run.
  3. Raise the separate sound or bleed event and verify its delay, interval, and repeat count.

Project code applies damage and raises the event. Adjust callback targets, conditions, and timing on the event or Receiver that owns them.

Configure conditions and actions