I am trying to add a listener to an event through a function.
event Action ExampleEvent; void AddListener(Action emitter, Action receiver) { emitter += receiver; } Then somewhere I call it like this:
AddListener(ExampleEvent, () => Console.WriteLine("Example event received")); ExampleEvent?.Invoke(); But there is no output. I don't see what's missing.