# Events

The **Events** system defines modular gameplay triggers that can be configured in the editor.

## Event Types

### Repeatable Events

* Executes logic each time it is activated.
* Examples:
  * [**ShowObjectsTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Repeatable/Trigger/ShowObjectsTriggerEvent.cs) – Shows objects while inside the bounds of a trigger `Collider`. For example, to show decorative `GameObject`s that should only be visible when the player is nearby during a location-based experience.
  * [**PlayAudioTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Repeatable/Trigger/PlayAudioTriggerEvent.cs) – Plays an audio clip while inside the bounds of a trigger `Collider`. Requires an `AudioManager` in the scene and an `AudioRegistry` in a Resources folder. For example, to play narrative audio as a player walks around a self-guided AR tour.

### Completable Events

* Executes logic once when activated and marks it as complete.
* Implements `ISaveable` to optionally make the `CompletableEventState` persist across app launches using the [Save System](https://docs.meshmap.com/unity-sdk/building-blocks/save-system) feature.
* Examples:
  * [**SpawnObjectsTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Completable/Trigger/SpawnObjectsTriggerEvent.cs) – Spawns objects at intervals upon entering the bounds of a trigger `Collider`. For example, to spawn enemy `GameObject`s that a player must defeat in a location-based AR game.
  * [**SwitchObjectsTriggerEvent**](https://github.com/MeshMap/com.meshmap.sdk.bb/blob/main/Runtime/Events/Completable/Trigger/SwitchObjectsTriggerEvent.cs) – Switches the active/inactive states of objects upon entering the bounds of a trigger `Collider`. For example, to swap the content that is shown along the return path of a location-based AR tour experience.

## Prefabs

Ready-to-use examples with placeholder objects assigned for **ShowObjectsTriggerEvent**, **SpawnObjectsTriggerEvent**, and **SwitchObjectsTriggerEvent**.

{% embed url="<https://youtu.be/qxqGBvJandM>" fullWidth="false" %}
ShowObjectsTriggerEvent.prefab
{% endembed %}
