Summary
Phew, that was a monster chapter, folks! Congratulations on making your way through the ins and outs of the Factory Method pattern, complete with Unity implementations and a little reflection and LINQ syntactic sugar. The Factory Method pattern is one of those patterns that’s sometimes overlooked in favor of just using Prefabs and doing everything in the Editor (that’s one of Unity’s best qualities), but when you want to automate or programmatically control your assembly lines, this pattern is a must.
Remember, the Factory Method pattern is most useful when you want to defer class instantiation to subclasses. There are several Creator
class variations in the Factory Method pattern, including an abstract creator, concrete creator, and parameterized creator. Consider which option is best for your project – abstract factory method implementations lead to parallel hierarchies between concrete items and their creator classes, concrete factory classes...