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_02_Starterproject folder in Unity Hub. - Navigate to Assets | Scenes, and double-click on SplashScreen.
The starter project for this chapter has two scenes – a splash screen with the title of our little game and a button to start the adventure. When you click Start, the game transitions to a new scene, where you can move a capsule around a small arena and collect spheres.
As for the scripts:
Item.csis attached to eachItemprefab that is responsible for destroying itself when there’s a collision.Manager.csstores our score and loads the next scene.Player.csis responsible for moving our character around the scene using the WASD or arrow keys.ScoreUI.csstores aTextobject so that we can set an initial score value on our scene canvas...