Skip to content

Instantly share code, notes, and snippets.

nbrosz /
Last active June 4, 2023 18:20
Gatsby Blog To-Do
nbrosz / MessagingBehavior.cs
Created December 11, 2017 03:27
A rough first draft attempt at a custom message passing system for Unity.
View MessagingBehavior.cs
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Messaging {
public abstract class MessagingBehavior : MonoBehaviour {
public delegate void MessageHandler(MessagingBehavior source, object data);
private void SendMessage (MessagingBehavior source, GameObject target, string message, object data) {
MessageRouter.Inst.SendMessage(source, target, message, data);