This repository was archived by the owner on Mar 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Mar 7, 2026. It is now read-only.
feat: Define and manage Event system #5
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
🔗 Is your feature request related to a specific issue?
Communication between different game systems is often implemented via direct method calls or hard references. This creates high coupling, making it difficult to add or remove systems without breaking existing code.
💡 Feature Description
Implement a global, decoupled event bus (or message bus) system.
- Expected outcome or effect: Asynchronous communication between modules via broadcasting and listening for events, without requiring direct references.
- Specific implementation ideas: The following definitions are for reference only and are subject to change. Implementation could include:
- A central
EventBusorEventManagerclass. Subscribe<TEvent>(handler)method to listen for a specific event type.Unsubscribe<TEvent>(handler)method to stop listening.Publish(eventInstance)method to broadcast an event to all subscribers.- Event types can be defined by simple C# classes or structs (e.g.,
PlayerDiedEvent,ItemCollectedEvent).
- A central
- Usage scenarios or benefits:
- The player health component can publish a
PlayerDiedEventwhen health reaches zero. - The UI, audio manager, and game state manager can all subscribe to this event to perform their respective actions (show "Game Over" screen, play death sound, save progress) without knowing about the health component itself.
- The player health component can publish a
⚖ Alternatives Considered
N/A
📝 Additional Information
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog