Skip to content

Instantly share code, notes, and snippets.

-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFt8ACUBEADGde8BPTcDRFv6vZ356aEiq6YKZhrQCgzlXdrdJh6lXENPKEmN
5PBz/xjubNoLff4zlusaSKso2L6xG0PkSqXanLYAQUIB8TfML01gaBtmO+tIkHZP
o+yvBbtS9679T+twHDCT+t4kkt9FqsHzOSNvSEsqYEZ9/76YRqL0ijAlUOkwawAA
rBu217MEsrCvvsC94V3F6+6hgu+glDSuFPjfBjFIeM5uDJF9al2nB/UFoxwu0l3a
8Jmq6X92X16u0bXyzTxF7nfzhg8Vncp6LPZJteJGrx2OKvLaG8zzqq8bi3IjfJ2l
MVXlK7H9+t+1z2qCvRcu96maI4qrXjAgjja9lSRaTX23ZuhCqtz7egIH+cJgcMQe
zdMAvGSr3lpkQAuFQkIvxqoSg/4qVyzivMQ2ckjJ0IcLrCIy/1SCrgOCgv8XECzz
AJ3pXYkBV+YVWyin/l9W/qMmfVK5SNfGyU0YXkRS+TWcEwaKfa3D7VqM4RcL7Cq/
@edwios
edwios / Events & Delegates in Unity C#
Created March 13, 2023 07:54 — forked from dylanfries/Events & Delegates in Unity C#
Events and Delegates for Unity (C#)
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