Following on from the previous chapter, we will continue building our battle system.
Let's begin our focus on letting the player attack a single enemy. To do this, we'll add some variables to BattleManager
to manage this.
We will also add some other elements to spruce up the battle, such as a selection circle or a target identifier, and add a variable to set a prefab for this.
So, open the BattleManager
script and add the following variables to the top of the class:
private string selectedTargetName; private EnemyController selectedTarget; public GameObject selectionCircle; private bool canSelectEnemy; bool attacking = false; public bool CanSelectEnemy { get { return canSelectEnemy; } } public int EnemyCount { get { return enemyCount; } }