Other Examples for Decorator Pattern Usage in Game Dev

Looking online, it seems like the Decorator Pattern isn’t used much. I understand the fire ball example given in the lecture, but I would like to see how this pattern can be used in other aspects for comparison.

One of the less obvious uses of the Decorator pattern is in how we construct our GameObjects. The MonoBehaviours we add to the GameObject all get specific methods called on them by the system (Awake, Start, OnEnable, OnDisable, etc).

The Strategy pattern is, itself, a form of Decorator pattern, and this is covered in great detail in our Shops and Abilities course.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms