Why use Advanced CSharp Messenger instead of Delegate/Event or Action?

When I first started learning about Unity the Advanced CSharp Messenger(http://wiki.unity3d.com/index.php/Advanced_CSharp_Messenger) was always recommend to use. But in all my recent learning its either been Delegate/Event or Action used.

I have tried to wrap my head around what is actually best to use.

I prefer using Action since its much cleaner but worried this hurt performance. There must be reason for the Advanced CSharp Messenger existing otherwise why would you go to the length of adding that to the project?

The book “Unity in Action” made me even more confused as its states “…make use of a broadcast messanger system. Although Unity doesn’t have feature built in…”. How can this be true, C# comes with Delegate/Event or Action?

Since it’s related, this is Unity Technologies latest approach for a message/event ststem:

The point there is decoupling. The receiver does not need to know who is raising the event.

Started rewriting part of the code in my current project using CSharp Messenger and I must say that not needing to point specific broadcaster is awesome. Can’t believe it took me this long to understand how useful it is.

Thank you for the replies :slight_smile:

In my experience one downside is that the code becomes harder to read when you have enough messages being sent around.