Skip to main content

Organize Events with Databases and Categories

TinyGiants
Unity Games & Tools Developer

Put related events such as combat hits and defeats in one database, then use categories to split it into smaller groups. The database gives the team a shared place to find the assets and inspect their Behavior before editing a scene.

Split databases by gameplay domain​

Create a separate GameEventDatabase asset for a gameplay domain such as Combat or UI. In Game Event Manager, add the databases needed by the scene or project. Use categories within the Combat database for groups such as Damage, Death, and Buffs.

Several databases assigned to Game Event Manager

Keep events that are often edited together in the same database so you can filter and review their Behavior in one place.

Separate database assets in the Project window

Preserve event references while reorganizing​

Renaming an event inside a database preserves its event ID. Moving the database in the Unity Project window preserves its Unity asset GUID. If you migrate an event between databases, verify references to the original Unity sub-asset with Event Finder and update them as needed.

Register databases at runtime​

When a module supplies a database at runtime, call GameEventManager.RegisterDatabase(database) after the asset loads. Call UnregisterDatabase(database) when the module is done with the manager registration. For an Addressables database, use the optional integration to hold and release a lease for the asset.

Reduce edits to the same database​

With separate databases, four developers working simultaneously touch four different files:

Developer A: adds OnQuestAccepted to QuestEvents.asset
Developer B: adds OnItemCrafted to InventoryEvents.asset
Developer C: modifies OnPlayerDamaged in CombatEvents.asset
Developer D: adds OnNPCDialogueStarted to SocialEvents.asset

Changes to different database files are independent. Review the serialized asset together when two people edit the same database.

Manager Databases

Filter events and review their Behavior​

Select the Combat database in Game Event Editor, then use Category, Type, and the search field together. For example, select Damage and SingleGameEvent, then search for player to find player-related damage events with a float parameter.

Event Editor toolbar and filters

Use the Behavior button to inspect an event's Inspector bindings. Green identifies Inspector bindings, blue identifies runtime listeners, and orange indicates no bindings. Check references with Event Finder before deciding whether to remove an event.

Remove events you no longer need​

Select the correct database and clear any filters that would hide the events you want to review. Click Delete Event, select the confirmed rows, and review the confirmation list before deleting. Select All includes the events that match the current filters.

Delete Event button in Game Event Editor

Open the multi-database demo · Find references before deleting an event