Skip to content
github-actions[bot] edited this page Jul 4, 2026 · 6 revisions

title: Home description: Decoupled, simple systems for Unity template: home.html hide:

  • navigation
  • toc

Start Here

Install

OpenUPM

openupm add com.wallstop-studios.dxmessaging

Git URL

https://github.com/Ambiguous-Interactive/DxMessaging.git

See the Getting-Started-Install for scoped registry, Git URL, and local tarball options.

First Message

using DxMessaging.Core.Attributes;
using DxMessaging.Core.Extensions;
using DxMessaging.Unity;
using UnityEngine;

[DxTargetedMessage]
[DxAutoConstructor]
public readonly partial struct Heal
{
    public readonly int Amount;
}

public sealed class PlayerHealth : MessageAwareComponent
{
    protected override void RegisterMessageHandlers()
    {
        base.RegisterMessageHandlers();
        Token.RegisterGameObjectTargeted<Heal>(gameObject, OnHeal);
    }

    private void OnHeal(ref Heal message)
    {
        // Apply the heal to this player.
    }
}

public sealed class HealButton : MonoBehaviour
{
    [SerializeField]
    private GameObject _player;

    public void Click()
    {
        Heal heal = new Heal(25);
        heal.EmitGameObjectTargeted(_player);
    }
}

Why Teams Use It

Simple primitives

Three message shapes - untargeted, targeted, broadcast - and nothing else to learn. Each contract is an explicit typed struct, and no system holds a reference to any other.

Easy to use

Define a struct, register a handler, emit. Registration tokens follow their owner's lifecycle, so handlers remove themselves - no manual unsubscribe, no leaked listeners.

Small edits, big impact

The same simple primitives decouple entire systems. Wiring a feature in is one registration; removing it is deleting that line. Interceptors, handler priorities, and global observers layer on without touching existing code.

High performance

Struct messages and by-ref handlers keep steady-state dispatch at zero allocation. Type-indexed routing stays O(1), with published results around 10 ns per handler.

Next

Clone this wiki locally