Game Events
Game Events
noCTRL Game Events
Performant, extensible in-game event system for Unity.
Create events as assets, reference them anywhere in your project, and decouple your game logic without relying on hard-coded dependencies.
β¨ Features
- ScriptableObject-based events for easy reusability and scene independence.
- Strong decoupling between event senders and listeners.
- Lightweight & performant runtime.
- Custom Editor tools for debugging and event management.
- Sample scenes to get started quickly.
- Fully compatible with Unity 2021.3+.
π Crediting noCTRL Studios
If you use this package, you must credit noCTRL Studios and include a link to its GitHub repository:
https://github.com/noCTRL-Studios
Include this in your project documentation, README, or game credits. Just as long as it is some place!
π¦ Installation
Unity Package Manager (Git URL)
- Open Unity β Window β Package Manager.
- Click the + button β Add package from git URLβ¦
- Paste:
1
https://github.com/noCTRL-Studios/Unity-Game-Events.git
π Quick Start
1. Create an Event Asset
- Right-click in the Project window.
- Select Create β Game Events β New Game Event.
- Name it (e.g.,
OnCoinCollected).
2. Raise an Event in Code
1
2
3
4
5
6
7
8
9
10
11
12
using UnityEngine;
public class Coin : MonoBehaviour
{
public GameEvent OnCoinCollected;
public void Collect()
{
OnCoinCollected.RaiseAll();
Destroy(gameObject);
}
}
3. Listen for the Event
Use the GameEvent Listener component:
- Add the listener component to a GameObject.
- Drag your GameEvent asset into the componentβs Event field.
- Select a response from the available prefab functions.
π§ͺ Sample Scene
A ready-to-use example scene is included in:
1
Samples~/Basic Usage
Demonstrates:
- Creating and raising events
- Listening and responding to events
- Debugging events in the Inspector
π Project Structure
1
2
3
4
Runtime/ # Core runtime scripts (events, listeners)
Editor/ # Custom editors for workflow improvements
Samples~/ # Example scenes and scripts
Tests/ # Optional automated tests
π€ Author
noCTRL Studios β Tools and SDKs π§ silashafeli@noctrlstudios.com
π https://noctrlstudios.com
This post is licensed under CC BY 4.0 by the author.