This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Events & Delegates | |
------------------ | |
Events and Delegates were something I struggled with when I was first learning how they worked. Once I figured it out it became one of the most useful and powerful techniques for games. Its especially useful for helping to decouple classes while allowing for messaging. | |
Delegates - Simply a container for a function that can be used as a variable. | |
Events - Allows you to specify a delegate that gets called when some event in your code is triggered. | |
Overview |