Fight State
This BattleState makes the characters of both teams battle each other. The dragging of characters will be disabled, but the dragging of items will not, so is it possible to equip a character during the battle. The battle will continue until the time runs out or a victory or defeat condition is met, and the next state will be executed.
Create a Fight State
1. Right click on a project folder and click on "Create/Auto-Battle Framework/BattleStates/FightState". This will create a new Fight State.
Create the Preparation State.
2. Select the newly created Fight State. The following can be configured in its Inspector:
- Time: Duration of the state.
- Show in UI: If true, show the state in the Stage UI. Check this option.
- UI Prefab: Prefab that represents the image of the state. We recommend always using an image for the Fight State, we will use the one found in "Auto-Battle Framework/Prefabs/UI/FightImage". If you want to modify a prefab, we recommend to make a duplicate of it (CTRL + D) and modify it from there.
- Hide Cells: Hide the Battle Grid cells at the beginning of this state. When finished they will be shown again.
- Currency Per Round: Amount of currency earned when the fight is won.
- Win Condition: Select a victory condition. Descriptions of each can be found here.
- Lose Condition: Select a lose condition. Descriptions of each can be found here.
Fight State configuration. Select an UI Prefab.
3. The state is ready to be added to a Battle Stage. This is explained in detail in the section Creating a new Battle Stage.
Add the Fight State to the Battle Stage.