Skip to main content

Game Event Creator

Your high-speed event creation wizard. This specialized tool handles batch event generation, automatic code compilation, and ScriptableObject creationβ€”all in one streamlined workflow.

πŸ”ˆ Hover for sound

πŸš€ Opening the Creator​

The Creator only opens from the Game Event Editor:

Game Event Editor β†’ Click "+ New Event" button (top-right)
Why From Editor Only?

The Creator needs to know which database to add events to. Opening from the Editor ensures proper context.


πŸ—ΊοΈ Interface Zones​

The window is organized into four functional areas:

ZoneLocationPurpose
A. Event Mode TabsTopSwitch between Void, Single Parameter, or Sender events
B. Configuration AreaMiddleSelect types and configure event details
C. Events QueueBottomReview pending events before creation
D. Status BadgeTop-rightShows total queued count (e.g., "7 Queued Total")

🎭 Three Event Modes​

Choose the architecture that fits your need:

Parameterless Events​

Type: GameEvent (Void)

The simplest signalβ€”no data, just notification.

Parameterless Mode

Best For:

πŸ–±οΈ UI Triggers βž” OnPauseButtonClick, OnMenuOpen
🌍 Global States βž” OnGameStart, OnLevelComplete
πŸƒ Simple Actions βž” OnJump, OnFire, OnInteract

How to Use:

  1. Click "Add Event" button
  2. Event appears in queue with default name "NewEvent"
  3. Rename it in the queue (e.g., "OnGameStart")
  4. Set category if desired (e.g., "Core")
  5. Click "Create X Event(s)" at bottom

No Type Selection Needed: Since it's parameterless, you just click and add.


πŸ“¦ Batch Creation Workflow​

The Creator's power is batch processingβ€”create many events at once instead of one-by-one.

Step-by-Step Process​

1️⃣ Queue Events​

Add multiple events across different modes:

πŸ”˜ Switch to Parameterless βž” Add OnGameStart  
πŸ”˜ Switch to Parameterless βž” Add OnGamePause
πŸ”’ Switch to Single Parameter(int) βž” Add OnScoreChanged
🌊 Switch to Single Parameter(float) βž” Add OnHealthChanged
πŸ‘₯ Switch to Sender <GameObject,int> βž” Add OnEnemyDamaged

Total in Queue: 5 events pending creation

Visual Feedback:

  • Top-right badge updates: "5 Queued Total"
  • Each mode shows its own count: "Events Queue (2)"

2️⃣ Review & Configure​

In the Events Queue section:

Per Event:

  • β˜‘οΈ Checkbox: Toggle selection (only selected events will be created)
  • Name Field: Rename event (default: "NewEvent", "OnInt", etc.)
  • Category Field: Set category for filtering later
  • Type Label: Shows event type signature
  • Γ— Button: Remove from queue

Bulk Actions:

  • Select All: Check all events in current queue
  • Clear Selection: Uncheck all events
  • Remove All: Clear entire queue (with confirmation)

3️⃣ Execute Creation​

Click the big green button at bottom:

+ Create 5 Event(s)

What Happens Next: See the next section ⬇️


βš™οΈ Understanding the Creation Process​

When you click "Create", a sophisticated automation pipeline runs. Here's what happens behind the scenes:

Scenario 1: Code Already Exists βœ…β€‹

Example: Creating an int event.

Speed: Instant (< 1 second)

No Compilation: You see the event in the Editor immediately.


Scenario 2: Code Needs Generation βš οΈβ€‹

Example: Creating a PlayerData event (your custom class).

Speed: 3-10 seconds (depends on project size)

You'll See:

  1. Creator window closes
  2. Unity compilation spinner appears
  3. Console logs appear
  4. Event appears in Editor automatically
What Gets Generated?

For each custom type, the system creates one C# file containing:

// File: PlayerDataGameEvent.cs

// 1. The Event Class
public class PlayerDataGameEvent : GameEvent<PlayerData> { }

// 2. The Binding Field (for Inspector)
public partial class GameEventManager {
public partial class EventBinding {
public UnityEvent<PlayerData> PlayerDataGameEventAction;
}
}

Why Both? The event class is for raising events. The binding field is for Inspector callbacks.


Mixed Batch Handling​

What if you queue both existing and new types?

Your Queue:
1. OnGameStart (void) βœ… Code exists
2. OnScoreChanged (int) βœ… Code exists
3. OnPlayerDataChanged (PlayerData) ⚠️ Needs generation
4. OnQuestCompleted (QuestData) ⚠️ Needs generation

System Behavior:

Console Output:

βœ… [Batch] Immediate events created successfully. (2 events)
⏳ Generated 2 script files. Triggering compilation to finish creation...
(After compilation)
🎯 Batch Creation Complete: 2 events created.

Sender Events Special Case​

Sender events (GameEvent<TSender, TArgs>) follow the same logic but generate more complex code:

// File: GameObjectDamageInfoGameEvent.cs

// Event class with TWO type parameters
public class GameObjectDamageInfoGameEvent
: GameEvent<GameObject, DamageInfo> { }

// Binding field with TWO parameters
public UnityEvent<GameObject, DamageInfo>
GameObjectDamageInfoGameEventAction;

🎯 Best Practices​

βœ… DO​

Pre-Generate Common Types: If you know you'll use certain types frequently, you can refer to Code Gen & Cleanup to pre generate custom type classes and event binding code.


Use Meaningful Names

βœ… Good Names:
- OnPlayerHealthChanged
- OnEnemySpawned
- OnQuestCompleted
- OnScoreUpdated

❌ Avoid:
- NewEvent1
- Test
- Event_Copy
- TempEvent

Organize with Categories

Use categories to group related events:

πŸŸ₯ Category: "Combat"
- ⚑ OnDamageTaken
- ⚑ OnEnemyKilled
- ⚑ OnWeaponFired

🟩 Category: "UI"
- ⚑ OnButtonClicked
- ⚑ OnMenuOpened
- ⚑ OnDialogClosed

πŸŸͺ Category: "Player"
- ⚑ OnPlayerJumped
- ⚑ OnPlayerDied
- ⚑ OnLevelUp

❌ AVOID​

Don't Close During Compilation

❌ WRONG:
1. Click Create
2. See "Triggering compilation..." message
3. Immediately close Unity or force-stop compilation

βœ… RIGHT:
1. Click Create
2. Wait for compilation bar to finish
3. Events appear automatically

Why? Interrupting compilation may leave generated code files without corresponding assets.


Don't Manually Edit Generated Files

❌ WRONG:
Open: TinyGiantsData/GameEventSystem/CodeGen/Custom/PlayerDataGameEvent.cs
Edit: Add custom methods, change namespace, etc.

βœ… RIGHT:
Let the system manage generated files.
Extend functionality through separate scripts.

Why? The system may regenerate these files, overwriting your changes.


πŸ” Progress Indicators​

During Creation​

Immediate Creation (code exists):

βœ… Events created successfully.

Code Generation (new types):

⏳ Generated 3 script files. Triggering compilation to finish creation...

After Compilation:

🎯 Batch Creation Complete: 1 events created.

Console Logs Explained​

Detailed Generation Report:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧩 Event Code Generation Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

βœ… Generated 3 event files (Type + Binding).

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

What This Means:

  • 3 new C# files created
  • Each file contains event class + binding field
  • Files are in TinyGiantsData/GameEventSystem/CodeGen/Custom/
  • Assets will be created automatically after compilation

❓ Troubleshooting​

Events Not Appearing After Compilation​

Problem: Clicked Create, compilation finished, but events missing.

Solutions:

Check Console for Errors:

Look for red errors during compilation
Common issue: Type not serializable
Fix: Add [System.Serializable] to your class

Verify Database Selection:

1. Open Game Event Editor
2. Check which database is selected
3. Events are added to THAT database

Manual Asset Check:

1. Navigate to: TinyGiantsData/GameEventSystem/Databases/
2. Find your database asset
3. Expand it in Project window
4. Look for your event sub-assets

Compilation Takes Too Long​

Problem: Stuck on "Compiling Scripts..." for minutes.

Causes:

  • Large project with many scripts
  • Other compilation errors blocking progress
  • Unity Editor performance issues

Solutions:

1. Check Console for compilation errors
2. Fix any red errors first
3. Try: Assets β†’ Reimport All (last resort)
4. Restart Unity if stuck > 5 minutes

"Type Not Found" After Generation​

Problem: Console says type not found even after compilation.

Checklist:

βœ… Is your type [Serializable]?

βœ… Is your type public?

βœ… Does Unity recognize your type? (check Inspector)

βœ… Did compilation actually finish? (no spinner)

Fix:

// Make sure your class looks like this:
using System;
using UnityEngine;

[Serializable] // ← Required
public class PlayerData // ← Must be public
{
public string playerName;
public int level;
}

Duplicate Event Names​

Problem: Two events with same name in queue.

Behavior: System auto-renames with suffix:

Queue:
- OnPlayerDeath
- OnPlayerDeath_1
- OnPlayerDeath_2

Better Practice: Rename manually in the queue before creating it.


Pro Workflow

First-Time Setup: Create all your common event types in one batch session. Wait for compilation once. From then on, event creation is instant since all code exists. This one-time investment saves hours over the project lifetime.

Code Location

Generated files live in:

Assets/TinyGiantsData/GameEventSystem/CodeGen/
β”œβ”€ Basic/ (pre-generated for int, float, etc.)
└─ Custom/ (your custom types)

These folders are safe to commit to version controlβ€”they're deterministic and won't cause merge conflicts.