Sign in to follow this  
farzher

C# Event Dispatching?

Recommended Posts

I come from ActionScript 3. Is there a way to dispatch events in C# and have different objects listen for them?

So like in the Player class when it dies it dispatches an "i died" event. And anyone listening gets notified running the handler function.

Share this post


Link to post
Share on other sites
Yes, C# has direct support for events. You can get more info here, but you'll probably want to read the section on delegates first, since events build on them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this