Type-safe event system for Unity with ScriptableObject channels, DI-ready architecture, and high-performance dispatch.Stop coupling unrelated systems with direct references, static globals, or fragile string-based events!Messenger gives you three things at once that are usually a trade-off: full compile-time type safety, near-zero allocation dispatch, and Inspector-friendly ScriptableObject channels. Refactor a message and the compiler finds every sender and listener. Fire thousands of events per frame without feeding the garbage collector.Messenger is a code-first, type-safe publish-subscribe event system for Unity that helps you decouple gameplay, UI, audio, analytics, meta, and service systems without string keys, enum registries, or hard references.Use Messenger as a local event system in pure C#, inject it through your composition root, or share ScriptableObject Channel assets across prefabs and scenes when you want Inspector-friendly communication without singletons or global state.Why not plain C# events or a static event system?C# event fields recreate the tight coupling you are trying to remove and are easy to leakStatic event systems and string or enum keys break silently on rename and have no compile-time safetyHeavier reactive frameworks add a large dependency and a learning curve for what is often just messagingMessenger stays small and focused: one clear publish-subscribe API, strong typing, measured performance, and no external dependencies.Why choose Messenger:Strongly typed messages for safer refactoring and cleaner APIsNo string keys or enum registries to maintainExplicit Send(in T) and Signal() flows for payload messages and no-data signalsHigh-performance, low-allocation dispatch with cached signals and benchmarked runtime behaviorFluent subscriptions with a single IDisposable for lifecycle cleanupScriptableObject Channels for cross-scene and cross-prefab messagingOptional logging, exception handling, thread safety, capacity tuning, and custom cache supportDI-friendly IMessenger interface with examples for Zenject, VContainer, Reflex, and pure DIRe-entrancy-safe dispatch with deferred subscribe/unsubscribe during message processingExtensive documentation, 4 sample scenes, 481 tests, benchmarks, and zero external dependenciesMessenger is built for teams that want clean, scalable architecture without heavyweight frameworks: from small projects that need cleaner communication to larger codebases that need predictable behavior, low overhead, and easier testing.Want to see it first? Import any of the 4 included demo scenes from the Package Manager and press Play - basic usage, ScriptableObject channels, the fluent API, and multi-threaded workers each run out of the box.Core components:Messenger (runtime event system)Channel (ScriptableObject-based shared messaging)Builder configuration APIIMessenger / ISubscriberILogger / ICache extensibility pointsMain capabilities:Strongly typed publish-subscribe API with no string keys or enum registriesSend(in T) for payload messages and Signal() for cached no-data signalsFluent multi-subscription API returning a single IDisposableOptional logging, exception handling, thread safety, capacity tuning, auto-release capacity, and custom cache supportRe-entrancy-safe dispatch with deferred subscribe/unsubscribe during active message processingDeterministic subscription orderDI examples for Zenject, VContainer, Reflex, and pure C# compositionIncluded content:4 sample scenesBenchmarks and stress tests481 unit tests across 51 test fixturesFull documentationBenchmark snapshot (Apple Silicon, Unity 6.3, Mono runtime):Zero GC: dedicated Send/Signal dispatch tests observed 0 garbage collections over 10,000 iterationsSend: ~4.3M ops/sec with 10 subscribersSignal: ~3.2M ops/sec with 10 subscribersSupported platforms:WindowsmacOSLinuxAndroidiOSWebGLImportant behavior notes:Message dispatch is exact-type by design, interface/base-type dispatch requires explicit generic typingSignal() is intended for no-data/default-constructible message typesChannel uses an internal default Messenger configuration




