Download

Events or Delegates? What to use?

Hi there,

I’m struggling about what and how to use: Events or Delegates. Let’s assume the following setup:

How can I achieve that class b reacts on event or delegate fired by class a?

Thanks in advance.

PS: Sorry for link but upload picture doesn’t work at the moment.

It’s me again. Perhaps it’s unclear what I want to do, so let me explain it a little bit:

I have a class A being a callback class from an external api. When the API forwards a message it calls a function in class A. I have another class B (PlayerController) that must react on the message called in class A by the API. My thought was that I could declare an event or delegate in class A that get’s broadcasted when class A receives a message from the API and then class B notices the event from A got fired and reactes on that.

Is something like that possible?