Technical requirements
Before you dive in:
- Download or clone the GitHub repository at https://github.com/PacktPublishing/C-Design-Patterns-with-Unity-First-Edition
- Open the Ch_03_Starter project folder in Unity Hub.
- In Assets | Scenes, double-click on SampleScene.
Now that you’re ready to go let’s look at the starter project, which is a single scene with an empty ground plane ready for enemies to be spawned and a set of pre-made scripts to make life easier.
As for the scripts:
DataSpawner.cs
is attached to an emptyGameObject
in the scene calledEnemy Spawner
and right now there’s only oneOgre
created with its stats printed out.Enemy.cs
is the base class for our future C# objects.BaseEnemy.cs
is the base class for when we clone prefabs.AshKnight.cs
andOgre.cs
are two concrete enemy types that inherit fromBaseEnemy
.
We’ll be creating different spawning scripts for prefabs...