This repository shows how one can use Strategy Pattern (from the book by GoF) in Unity.
Side note: the example is really simple and stupid, and serves as just a demo.
Here, Strategy Pattern is used to dynamically change how the cube moves. There are 3 possible modes:
- Manual - controlled by player.
- Random - it chooses where to move randomly.
- DVD screensaver (poor copy, but still funny).
- Arrows to move (when in
Manualmode). Spaceto cycle between manual, random velocity, and DVD screensaver modes.
