Create a new Battle Stage
In this section we will create a new Battle Stage from scratch. The states created in the previous sections will be used:
- Preparation State, from Create a new Preparation Stage.
- FightCountdown State, from Create a new Battle State.
- Fight State, from Create a new Fight State.
- Change Stage State, from Create a new Change Stage State
By placing the states in this order, we will create a Stage in which first the player will be able to buy, move and equip, then there will be a small countdown until the fight starts, and after finishing it, it will link to the Stage of the test scene. It is essential that there is always a Preparation State before a Fight State, since the characters of the enemy team must spawn.
Follow these steps to create a new Battle Stage:
1. Right click on a project folder and click on "Create/Auto-Battle Framework/BattleStates/Stage". This will create a new Battle Stage Scriptable Object.
Create the Battle Stage.
2. Select the newly created Battle Stage. Add to the Battle States list the states in the order described above.
Adding the states to the Battle Stage.
3. Select the Auto-Battle GameObject in the scene. In the Battle component Inspector, attach the created Battle Stage to the Stage variable.
Add the Battle Stage to the Battle component.
4. Test the game. A single image should appear at the top indicating that there is only one battle. The rest of the states should not appear, since they have been indicated not to be shown in the UI.
Battle Stage UI. Only the Fight State is displayed.