Setting up objectives
In our RTS game, the player will have a list of objectives on each level to complete before running out of time. The objectives are a mix of collecting resources and killing enemies, as well as completing them before the time is up. We are going to create a few scripts and a ScriptableObject to help us configure the objectives and include them in the level so that the player knows what needs to be done in the current level to win the game.
Let’s start with our first script, which will be a base for the following couple of scripts, which will list objectives related to resources and enemies. In the Scripts folder, create a new folder called Objective
, and add a new script with the name BaseObjective
. Then replace the content with the following code:
using System; namespace Dragoncraft { [Serializable] public class BaseObjective { public int Quantity; } }
The BaseObjective
class...