DxMessaging Documentation Hub¶
This is the documentation for DxMessaging, a type-safe messaging system for Unity.
Visual Documentation Map¶
flowchart TD
Start[START HERE<br/>Visual Guide<br/>5 minutes]
Start --> Quick[Quick Start<br/>5 min]
Start --> Getting[Getting Started<br/>10 min]
Start --> Overview[Overview<br/>5 min]
Quick --> Patterns[Patterns & Samples<br/>Hands-on!]
Getting --> Patterns
Overview --> Patterns
classDef primary stroke-width:3px
class Start primary
classDef success stroke-width:2px
class Patterns success
classDef secondary stroke-width:2px
class Quick,Getting,Overview secondary Table of Contents¶
- New to DxMessaging
- Learning Path
- Core Documentation
- Reference
- Examples and Samples
- By Use Case
- Quick Start Path
New to DxMessaging¶
Never used a messaging system before? Start here:
- Mental Model - How to think about DxMessaging (10 min)
- Visual Guide - Beginner-friendly visual introduction (5 min)
- Getting Started Guide - Comprehensive guide with examples (10 min)
- Quick Start - Your first working message (5 min)
- Overview - What DxMessaging is and why it exists (5 min)
Learning Path¶
For Absolute Beginners (Never Used Messaging Before)¶
- Read Mental Model (10 min) - Philosophy first!
- Read Visual Guide (5 min) - Pictures and analogies!
- Read Getting Started (10 min) - Complete introduction
- Try Quick Start (5 min) - Hands-on tutorial
- Understand Message Types (10 min) - When to use what
- Study Common Patterns (15 min) - Real examples
For Advanced Users¶
- Master Interceptors & Ordering
- Explore Listening Patterns
- Deep dive into Design & Architecture
- Review Advanced Topics
Core Documentation¶
Essentials¶
- Visual Guide - Beginner-friendly visual introduction with pictures and analogies
- Getting Started - Complete beginner's guide with mental models
- Overview - What and why
- Quick Start - First message in 5 minutes
- Message Types - When to use Untargeted/Targeted/Broadcast
- Comparisons - DxMessaging vs C# Events, UnityEvents, SendMessage
Core Concepts¶
- Interceptors & Ordering - Validate, transform, control execution
- Listening Patterns - All the ways to receive messages
- Targeting & Context - GameObject vs Component
- Patterns - Real-world usage patterns
Unity Integration¶
- Unity Integration - MessagingComponent, MessageAwareComponent
- Diagnostics - Inspector tools, debugging, observability
Architecture & Performance¶
- Design & Architecture - Deep dive into internals and optimizations
- Performance Benchmarks - OS-specific tables auto-generated by tests
- Advanced - Lifecycles, safety, manual control
Reference¶
Quick Lookups¶
- Glossary - All terms explained in plain English
- Quick Reference - API cheat sheet
- API Reference - Complete API documentation
- FAQ - Common questions
- Troubleshooting - Solving common issues
Tools & Utilities¶
- Helpers - Source generators, attributes, extensions
- Message Bus Providers - Provider system and MessageBusProviderHandle for flexible bus configuration
- Runtime Configuration - Setting message buses at runtime, re-binding registrations
- Registration Builders - Fluent API for building message registrations
- Emit Shorthands -
Emit/EmitAt/EmitFromusage and pitfalls - String Messages - Prototyping and debugging
- Compatibility - Unity versions and render pipelines
- Install - Installation guide
Examples and Samples¶
Unity Samples (Importable!)¶
Located in Samples~/ directory - Import via Unity Package Manager!
- Mini Combat - Interactive combat demo with Heal/Damage messages
- Perfect first example to understand message flow
- Shows Targeted and Broadcast messages in action
-
Complete working scene you can play with
-
UI Buttons + Inspector - Interactive diagnostics demo
- See the Inspector diagnostics in action
- Explore message history and handler registrations
- Great for debugging and understanding the system
Code Examples (In Docs)¶
- End-to-End Example - Complete feature walkthrough
- Scene Transitions Example - Scene management pattern
Real-World Patterns¶
From Common Patterns:
- Scene-wide events (Untargeted)
- Directed commands (Targeted)
- Observability (Broadcast)
- Validation with Interceptors
- Analytics with Post-Processors
- Local bus islands for testing
By Use Case¶
"I want to..."¶
- Decouple my systems - Start with Getting Started
- Replace C# events - See Comparisons
- Send a command to one object - Use Targeted Messages
- Broadcast an event - Use Broadcast Messages
- Notify globally - Use Untargeted Messages
- Validate messages before execution - Learn Interceptors
- Track all damage/events - See Listening Without Context
- Debug message flow - Use Diagnostics
- Optimize performance - Read Performance Tips
- Isolate tests - Create Local Bus Islands
- Use dependency injection - DxMessaging + Zenject, DxMessaging + VContainer, DxMessaging + Reflex
- Configure buses at runtime - See Runtime Configuration
- Use message bus providers - Learn Message Bus Providers
Visual: Message Pipeline¶
Every message flows through 3 stages:
flowchart LR
P[Producer] --> I[Interceptors<br/>validate/mutate/cancel]
I --> H[Handlers<br/>main logic by priority]
H --> PP[Post-Processors<br/>analytics/logging]
classDef neutral stroke-width:2px
class P neutral
classDef warning stroke-width:2px
class I warning
classDef primary stroke-width:2px
class H primary
classDef success stroke-width:2px
class PP success Learning Resources¶
Must-Read Docs (In Order)¶
- Getting Started - Start here! (10 min)
- Message Types - Choose the right type (10 min)
- Patterns - See real examples (15 min)
- Diagnostics - Debug like a pro (10 min)
- Design & Architecture - Understand the internals (30 min)
Feature-Specific¶
- Priority & Ordering - Interceptors & Ordering
- Global Observers - Listening Patterns
- Unity Lifecycle - Unity Integration
- Performance - Design & Architecture
Comparison Charts¶
DxMessaging vs Alternatives¶
From Comparisons:
| Feature | DxMessaging | C# Events | UnityEvents | Static Bus |
|---|---|---|---|---|
| Decoupling | Full | Tight | Hidden | Yes |
| Lifecycle Safety | Auto | Manual | Unity | Manual |
| Execution Order | Priority | Random | Random | Random |
| Observability | Built-in | No | No | No |
| Performance | Zero-alloc | Good | Boxing | Good |
Search by Topic¶
Concepts¶
- Messages - Message Types, Getting Started
- Handlers - Listening Patterns, Unity Integration
- Lifecycle - Advanced, Unity Integration
- Performance - Design & Architecture
- Testing - Patterns, Testing Guide
Features¶
- Interceptors - Interceptors & Ordering
- Post-Processors - Interceptors & Ordering
- Priorities - Interceptors & Ordering
- Global Accept-All - Listening Patterns
- Diagnostics - Diagnostics
- Local Buses - Design & Architecture
Components¶
- MessageBus - Design & Architecture
- MessageHandler - API Reference
- MessageRegistrationToken - Unity Integration, Advanced
- MessageAwareComponent - Unity Integration, Getting Started
- MessagingComponent - Unity Integration
Complete Document List¶
Getting Started¶
- Visual Guide - Perfect for beginners
- Getting Started Guide
- Overview
- Quick Start
- Install
Core Concepts¶
Unity¶
Deep Dives¶
Reference¶
Dependency Injection¶
- Runtime Configuration - Setting and overriding message buses, re-binding registrations
- Message Bus Providers - Provider system and MessageBusProviderHandle
- DxMessaging + Zenject - Zenject integration guide
- DxMessaging + VContainer - VContainer integration guide
- DxMessaging + Reflex - Reflex integration guide
Miscellaneous¶
- String Messages
- Compatibility
- End-to-End Example
- Scene Transitions Example
- Mini Combat Sample
- UI Buttons + Inspector Sample
Quick Start Path¶
Absolute Beginner? Follow this 40-minute path:
- 10 min: Mental Model - Understand the philosophy first!
- 5 min: Visual Guide - Pictures & analogies
- 10 min: Getting Started - Deep dive
- 5 min: Quick Start - Hands-on code
- 10 min: Try a Sample - See it in action
Want to go deep? Continue with:
- 15 min: Patterns
- 20 min: Interceptors & Ordering
- 30 min: Design & Architecture
Need help? Check FAQ or Troubleshooting.