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_13_Starter project folder in Unity Hub
- In Assets > Scenes, double-click on SampleScene
The project for this chapter is a simple scene with three prefab objects in front of the camera and a Client
ready to print out data to the console. Since this pattern is all about data (and not so much behavior-focused), our debug logs are an important part of learning how the code works before getting into Unity implementations.
As for the scripts:
Client.cs
is a blank slate attached to aClient
object in the scene.Monster.cs
hasprivate
properties and apublic
method for printing them out – this will be our Typed Object (or Instance Object, as we’ll call it, to avoid confusion).Pokemon.cs
is aMonoBehaviour
attached to thePokemon
prefab.
...