In this first hands-on chapter, we will review one of the most infamous software design patterns in the field of programming, the Singleton. It could be argued by many that the Singleton is the most widely used pattern among Unity developers, maybe because it's the most straightforward pattern to learn. But it can also quickly become the "duct tape" in our programming toolbox that we reach for every time we need a quick fix for a complex architectural problem.
For instance, when using this pattern, we can quickly establish a simple code architecture revolving around wrapping and managing all the core systems of our game in individual manager classes. Then we could have these managers expose clean and straightforward interfaces that will conceal the inner complexity of the systems. Also, to make sure that these managers...