In this tutorial we will learn about the ServiceLocator pattern. There are many ways to implement it but I find this particular one the most extensible and easy to use. I hope you enjoy the video.
The code can be found here:
https://github.com/x1r15/ServiceLocator
(Expect some minor changes & documentation updates)
This code relies heavily on some concepts we covered in other videos those are:
• How to make Unity better using Extens... - extension methods
• Unity Scripting: Improve Productivity... - attributes
• What is Generics and how to use it in... - generics
#Unity #Coding #ServiceLocator
00:00 Why do we need ServiceLocator?
00:40 Where to find the code and how to use the repository
01:33 General idea of ServiceLocator
04:31 Safe Register()
05:26 Forced Get()
09:55 Why generics?
15:59 Control what you can register
17:29 Renaming GameObjects for lazy people
19:05 How to never forget to register service
23:12 AutoRegistration technicalities
Watch video How to create and use Service Locator in Unity online, duration hours minute second in high quality that is uploaded to the channel PitiIT 07 April 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 3,926 times and liked it 129 visitors.