Delegates, Events, Actions and Funcs - The Observer Pattern (Unity & C#)
The observer pattern is essentially baked into C# and Unity. It comes in the form of delegates, events, actions, and to some extent funcs. The observer pattern de-couples the source of information from the object receiving the information. This makes unity projects more stable, easier to add mechanics, and far less likely to break. Blog Post Covering the Observer Pattern: https://onewheelstudio.com/blog/2020/7/24/observer-pattern-c-events Sebastian Lague's Delegate Series: https://www.youtube.com/watch?v=G5R4C8BLEOc Become A Channel Member: https://www.youtube.com/channel/UCkr9CPPqT9VWUjkpo3HcACg/join Buy me a coffee: https://www.buymeacoffee.com/onewheelstudio My video and streaming kit: https://kit.co/onewheelstudio/tutorial-video-production Game Design Reading Suggestions: https://kit.co/onewheelstudio/game-design-reading-list-unity-c-blender-and-more Discord: http://discord.onewheelstudio.com Patreon: https://www.patreon.com/onewheelstudio Twitter: https://twitter.com/OneWheelStudio Devlog: https://onewheelstudio.com/ Twitch: https://go.twitch.tv/onewheelstudio Video Gear List (Amazon Affiliate) ************ Sony A6100 Camera: https://amzn.to/32logXz Camera Lens: https://amzn.to/3KA4Wr4 GoXLR (audio interface): https://amzn.to/35dmr03 Shure SM7B Mic: https://amzn.to/3fNbV1E Blue Mic Arm: https://amzn.to/3tHgwdQ Neewer Light: https://amzn.to/3rD8eRv Light Softbox: https://amzn.to/3GUaHgQ Neewer RGB Light: https://amzn.to/3rCTQJ9 TimeCodes 0:00 Why you need the Observer Pattern? 1:20 Problems Solved 1:38 What does the Observer Pattern do? 2:41 What Are Delegates? 4:45 Defining Delegates 6:21 Delegate Parameters & Return Values 7:13 Multicast Delegate 8:01 Static Delegates 8:17 Events 9:08 Actions and Funcs 9:40 Observer Pattern Implementation #ProgrammingPatterns #ObserverPattern #UnityTutorial #GameDevelopment
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.