Database Management
GameCardManager registers all six GCS database types in one place, and the Active set determines which content Game Card Editor and GCSApi can discover
GameCardManager defines the content discovery scope
A card, deck, or encounter asset does not enter the current scene's authoring and query scope merely by appearing in the Project window. Game Card Editor and GCSApi can discover it only when its database is registered with the scene's GameCardManager and remains Active. When starting from an empty scene, use the following menu to open the Game Card System Dashboard, then click Initialize System:
Tools > TinyGiants > GCS > Game Card System
The first initialization creates GameCardManager and GameCardEncounterBootstrap, then registers all six preset databases as Active. On later initialization runs, the database step only restores missing preset entries. It does not remove project databases or reactivate presets that were set to Inactive. Select GameCardManager in the Hierarchy to see the registrations, Active count, and content count for all six database types in the Inspector:

The six sections above manage Card, Deck, Player Unit, Enemy Unit, Status, and Encounter databases. 1/1 Active means that only one database is registered for that type. Each section also keeps creation, registration, and routine maintenance together. The following diagram shows how database discovery and activation work:
The first path controls whether GCS can enumerate database content actively. The other preserves Unity direct references already assigned to decks, players, and encounters.
The Database dropdown at the top of Game Card Editor lists only Active databases.
Entity selectors for cards, units, statuses, and encounters prefer Active content. When the scene has no Manager, or when all Active databases contain no entries of that entity type, the selector falls back to a project-wide search. Seeing an item in a selector therefore does not prove that its database is currently Active.
Six database types form one battle
After registration and activation, each database appears in the corresponding Game Card Editor mode. Membership is defined by the entries recorded inside the database. Moving an asset into a same-named folder does not add it to the database.
| Database | Editor mode | Stored content | Responsibility in battle |
|---|---|---|---|
GameCardDatabase | Card | Cards | Cost, target, tags, upgrades, and Card Behavior |
GameDeckDatabase | Deck | Decks | Card entries, copy counts, starting decks, and reward pools |
GamePlayerUnitDatabase | Player | Player Units | HP, energy, starting deck, and player presentation assets |
GameEnemyUnitDatabase | Enemy | Enemy Units | HP range, tier, Intent, Behavior, and enemy presentation assets |
GameStatusDatabase | Status | Statuses | Buffs, Debuffs, stacking, decay, Hooks, and Status Behavior |
GameEncounterDatabase | Encounter | Encounters | Player, enemy lineup, Battle Rules, and reward deck |
These six content types are not isolated lists. A battle usually expands downward from GameEncounter: the Encounter selects the player, enemies, rules, and reward deck; the player connects a deck through Starting Deck; and the deck connects cards through its entries. FlowGraphs on cards, enemies, and statuses eventually execute in the same battle. Runtime Data Model explains how definitions create independent battle instances. FlowGraph Model explains how Behaviors read and modify those instances.
When you select a database asset in the Project window, its dedicated Inspector shows statistics for the content it contains. For example, GameCardDatabase presents the total card count, types, and rarities in one Summary:

Click Open in Card Mode to open the current card database directly in Game Card Editor. The other database Inspectors provide the corresponding mode shortcut.
All six Inspectors show the asset path and total content count. Enemy Database also groups counts by Tier, Status Database separates Buffs and Debuffs, and only Card Database reports Type and Rarity.
Create and register project databases
Preset databases provide runnable content structures to inspect. Your own project databases should live outside the plugin directory. When you create one with + New, the default root is Assets/TinyGiantsData/GameCardSystem/.
| Type | Default directory for + New |
|---|---|
| Card | CardDatabases/ |
| Deck | DeckDatabases/ |
| Player Unit | PlayerUnits/ |
| Enemy Unit | EnemyUnits/ |
| Status | StatusDatabases/ |
| Encounter | EncounterDatabases/ |
Every database section in the Manager Inspector provides the same operations.
| Operation | Result |
|---|---|
| + New | Creates a database in the corresponding project data directory, registers it immediately, and sets it Active |
| + Add | Lists unregistered databases of the same type in the project, then registers the selected database and sets it Active |
| Drag and drop | Registers one or more databases of the same type from the Project window. The same asset is never added twice |
| Active | Controls whether the database belongs to the active discovery scope of the current Manager |
| Locate | Selects the database asset in the Project window |
| Remove | Unregisters the database from the current Manager without deleting it from disk |
| Double-click name | Renames the database asset file directly |
You can also create a database directly in the target Project directory, then return to the Manager and register it with + Add or drag and drop:
Assets > Create > TinyGiants > GCS > Card Database
After registration, open Game Card Editor, switch to the matching content mode, and select the Active database from the Database dropdown at the top.
A complete project-database workflow follows this order:
- Use
+ Newin the matchingGameCardManagersection, or use+ Addto register an existing database. - Confirm that the database row is Active and check the Active count in the section heading.
- Open Game Card Editor and switch to the matching content mode.
- Select the target database from the Database dropdown.
- Create content and confirm in the database Inspector or Editor list that the entry was written to the correct location.
-
The remove button on a Manager row only unregisters the database. Delete in the Project window removes the database file and all of its content sub-assets.
-
After a database is deleted, direct references from decks, players, or encounters can become Missing. Check references before deletion.
Use Active sets to separate Demo, production, and test content
Active state belongs to the current GameCardManager, not to the database asset. The same database can remain Active in a Demo scene, stay registered but Inactive in a production scene, and be enabled only in a dedicated test scene.
| Separation dimension | Database example | Active strategy |
|---|---|---|
| Content source | Preset and project databases | Enable project databases in production scenes and enable presets temporarily only for comparison |
| Class | Warrior, Mage, Hunter, Priest | Enable only the class content needed for the current authoring or query mode |
| Act | Act 1, Act 2, Boss | Expose the content set required by the current scene or game mode |
| Test scope | Mechanic-validation and production databases | Enable test databases only in validation scenes so they do not enter production query results |
Once each scene maintains its own Active set, the databases available in Game Card Editor, the content returned by GCSApi, and the GUID lookup scope all change with the scene. Demo, production, and test scenes no longer share the same active discovery results.
GCSApimerges every Active database of the same type, but the current battle execution context uses only the first Active database in Manager registration order when resolving status, card, and enemy IDs.Change StatusandSpawn Unitare both limited by this boundary.Transform Cardis limited only when it resolves theNew Cardfield.Add Cardsfollows the same rule only when itsCardsinput receives noCardInstanceand the node falls back to its inlineCardsselector.- When using these inline content fields, place the target status, card, or enemy in the first Active database of the corresponding type. These nodes do not search across databases automatically, even when several Card, Status, or Enemy Unit Databases are Active.
Read the same content from code
The Database dropdown in Game Card Editor and GCSApi use the same Active databases from the current Manager. Code can read all six database types or retrieve all of their content directly:
using TinyGiants.GCS.Runtime;
var cardDatabases = GCSApi.ActiveCardDatabases();
var deckDatabases = GCSApi.ActiveDeckDatabases();
var playerDatabases = GCSApi.ActivePlayerUnitDatabases();
var enemyDatabases = GCSApi.ActiveEnemyUnitDatabases();
var statusDatabases = GCSApi.ActiveStatusDatabases();
var encounterDatabases = GCSApi.ActiveEncounterDatabases();
var cards = GCSApi.Cards();
var decks = GCSApi.Decks();
var players = GCSApi.PlayerUnits();
var enemies = GCSApi.EnemyUnits();
var statuses = GCSApi.Statuses();
var encounters = GCSApi.Encounters();
GUID lookup uses the same Active databases for all six content types:
var card = GCSApi.FindCard(cardGuid);
var deck = GCSApi.FindDeck(deckGuid);
var player = GCSApi.FindPlayerUnit(playerGuid);
var enemy = GCSApi.FindEnemyUnit(enemyGuid);
var status = GCSApi.FindStatus(statusGuid);
var encounter = GCSApi.FindEncounter(encounterGuid);
- When a Manager exists, all six
Active*Databases()methods and all six content collection methods create a new list on every call. Cache results for frequent reads instead of calling them repeatedly inUpdateor on every UI refresh. - When the scene has no valid Manager, list methods return empty collections and
Find*returnsnull.
See the GCSApi Guide and API Reference for battle control, content discovery, and complete method signatures.
Trace missing content through the dependency chain
Database problems are often mistaken for card, FlowGraph, or battle-startup problems. Start by determining whether the current feature depends on Active enumeration or a Unity direct reference, then follow the corresponding path.
| Symptom | Check first | Continue with |
|---|---|---|
| The target database is missing from the Database dropdown in Game Card Editor | Confirm that the current scene contains GameCardManager and that the target database is registered and Active | Confirm that the database type matches the current Editor mode |
| The Database dropdown contains the database, but the content list is empty | Confirm that the target database is selected and check Total in its Inspector | Check whether the new content was written to another Active database |
| An entity selector still shows Inactive content | Check whether all Active databases contain zero entries of that entity type, triggering project-wide fallback | Return to the Manager and inspect the actual Active set instead of inferring state from selector results |
GCSApi.Cards() or another content method returns an empty collection | Confirm that the Manager is valid and that at least one database of the corresponding type is Active | Check whether the Active database actually contains content |
GCSApi.Find* returns null | Confirm that the target content belongs to an Active database and verify the supplied GUID | Check for duplicate GUIDs and confirm the first matching entry in Manager registration order |
Change Status, Transform Card, Spawn Unit, or Add Cards with an inline Cards selector has no effect | Confirm that the target content belongs to the first Active database of the corresponding type | Confirm that FlowGraph actually reaches the node, then inspect its inputs and targets |
| A card in a deck can still be drawn after its card database becomes Inactive | This happens because Starting Deck and Deck Entry preserve valid direct references | If code must still enumerate or find the card by GUID, enable its database again |
| The Bootstrap Inspector reports that the default Encounter is not in an Active database | Register and enable the database that stores the Encounter to restore the Ready state | The warning does not prevent Bootstrap from starting the battle through the direct reference. Continue by checking the Encounter's player, enemies, rules, and reward-deck references |
To verify the complete content chain for an encounter, start with GameEncounter, then check the player, Starting Deck, cards, enemies, reward deck, and statuses used by FlowGraph. For deeper diagnosis, see Common Symptoms, Authoring Errors, and Runtime Errors.