Book Image

Learning Design Patterns with Unity

By : Harrison Ferrone
Book Image

Learning Design Patterns with Unity

By: Harrison Ferrone

Overview of this book

Struggling to write maintainable and clean code for your Unity games? Look no further! Learning Design Patterns with Unity empowers you to harness the fullest potential of popular design patterns while building exciting Unity projects. Through hands-on game development, you'll master creational patterns like Prototype to efficiently spawn enemies and delve into behavioral patterns like Observer to create reactive game mechanics. As you progress, you'll also identify the negative impacts of bad architectural decisions and understand how to overcome them with simple but effective practices. By the end of this Unity 2023 book, the way you develop Unity games will change. You'll emerge not just as a more skilled Unity developer, but as a well-rounded software engineer equipped with industry-leading design patterns.
Table of Contents (23 chapters)
21
Other Books You May Enjoy
22
Index

Summary

That wraps up our twin chapters on the Factory Method and Abstract Factory patterns! These two patterns, although related, are not the same and shouldn’t be used interchangeably or smooshed together into a Frankenstein factory. Always pick the right tool for the job!

Remember, the Abstract Factory pattern lets us abstract the creation process of families of related products. These object families should always be related, but they can be dependent on or interact with each other, and we can always extend our factories with parameters and factories of factories if necessary. Picking which solution to use depends on scale, product hierarchies, and the relationships you may or may not need between your objects and object families.

In the next chapter, we’ll explore how the Builder pattern helps separate the creation of complex objects from their representations and gives us the power of customized assembly lines!