Skip to content

DxMessaging Documentation

DxMessaging is a high-performance, type-safe messaging library for Unity that provides a clean, decoupled communication pattern between game components.

Get Started | View on GitHub

Why DxMessaging?

  • High Performance — Zero-allocation message dispatch with pooled handlers
  • 🛡️ Type-Safe — Compile-time message type checking prevents runtime errors
  • 📦 Decoupled Architecture — Components communicate without direct references
  • 🎯 Flexible Targeting — Untargeted, Targeted, and Broadcast message patterns
  • 🔧 Unity-Native — Built specifically for Unity with MonoBehaviour integration

Installation

Bash
openupm add com.wallstop-studios.dxmessaging

Or via Git URL

Text Only
https://github.com/wallstop/DxMessaging.git

See the Install Guide for all options including NPM scoped registries and local tarballs.

Quick Example

C#
// Define a message
public readonly struct DamageMessage : IUntargetedMessage
{
    public readonly int amount;
    public DamageMessage(int amount) => this.amount = amount;
}

// Subscribe and handle (using a MessageRegistrationToken)
_ = Token.RegisterUntargeted<DamageMessage>(msg =>
    Debug.Log($"Received {msg.amount} damage!"));

// Emit the message
DamageMessage damage = new DamageMessage(25);
damage.EmitUntargeted();