UnityEventAggregator icon indicating copy to clipboard operation
UnityEventAggregator copied to clipboard

Create base class to auto (un)register listeners.

Open EricFreeman opened this issue 11 years ago • 0 comments

You shouldn't have to manually register in the Start and unregister in the OnDestroy methods to use EventAggregator. This makes it easy to forget and introduce bugs, plus add unnecessary amounts of code. Make a baseclass that extends MonoBehaviour that just searches for all interfaces of IListener<(message)> and handles registration for you.

EricFreeman avatar Dec 18 '14 05:12 EricFreeman