Technical requirements
Before you start:
- Download or clone the GitHub repository at https://github.com/PacktPublishing/C-Design-Patterns-with-Unity-First-Edition.
- Open the Ch_11_Starter project folder in Unity Hub.
- In Assets | Scenes, double-click on SampleScene.
The project for this chapter doesn’t have any flashy mechanics, just a playable character that you can move around the scene and the ability to save your progress and eventually collect different upgrades (for now, we can only ineffectively bump into the little red orbs). The power of the Visitor pattern isn’t flashy, but it’s definitely one of the most valuable, and practical, design patterns to have in your toolbox.
As for the scripts:
Client.cs
stores aPlayer
variable and anempty
method hooked up to the Save button in the scene.Movement.cs
lets you control the character in the scene.Player.cs
has the required component attributes forMovement...