Search Unity

PotionMessenger - Compile-time safe messaging/event system

Discussion in 'Scripting' started by Asgardr, May 2, 2015.

  1. Asgardr

    Asgardr

    Joined:
    May 14, 2014
    Posts:
    14
    Hey there!

    I'm here to post my new messaging system, ported from zagabar's C++ implementation in Featherkit (with full permission).

    https://github.com/CptAsgard/PotionMessenger

    It's C# ready, so it doesn't require Unity, but I've been using it with great success. I hadn't seen anything like it, and it creates much better code than a system that requires string messages and pre-determined parameters.

    It's a compile-time safe messenger, where the messages are also the data. This means that you can't mistype the string message, so there's no asking yourself why a message isn't triggering. If you've made a mistake, it's clear before you've even hit Play.

    If you like it, or if there's something wrong, please let me know! If you'd like to contribute changes, feel free to do so via the GitHub repository.
     
    mgear likes this.
  2. Asgardr

    Asgardr

    Joined:
    May 14, 2014
    Posts:
    14
    Small bump, but I've added exception throwing by default and fixed some small issues. You can disable exception throwing and REQUIRERECEIVER by commenting out the define at the top of the MessageBus.cs file.

    If you've used this, please let me know! I'd love to hear if you're able to apply it successfully.