Technical requirements
To get started:
- Download or clone the GitHub repository at https://github.com/PacktPublishing/C-Design-Patterns-with-Unity-First-Edition
- Open the Ch_19_Starter project folder in Unity Hub
- In Assets | Scenes, double-click on SampleScene
The starter project for this chapter is pulled right from Chapter 2, Managing Access with the Singleton Pattern (it’s fitting that we start and end with similar scenarios and solutions). Our scene has a playable character that you can move and rotate using the WASD or arrow keys and three big red spheres that can be collected by running headlong into them!
As for the scripts:
Client.cs
is an almost empty script that has a placeholderAwake
method for our service registrations. We won’t be doing much work here other than testing our code.Item.cs
is a simple collectible script that implements theOnCollisionEnter
method and destroys the object it’s attached...