Class BattleState
It represents a state of the battle. It determines how the characters behave within the state and sets the conditions for moving to the next state.
For example, PreparationState allows to instantiate enemies, as well as move and equip characters, while state FightState allows both teams to battle each other.
Inheritance
Namespace: AutoBattleFramework.BattleBehaviour.States
Assembly: cs.temp.dll.dll
Syntax
public abstract class BattleState : ScriptableObject
Fields
ShowInUI
If true, show the state in StageUI
Declaration
public bool ShowInUI
Field Value
Type | Description |
---|---|
Boolean |
stage
The ScriptableBattleStage to which the state belongs.
Declaration
public ScriptableBattleStage stage
Field Value
Type | Description |
---|---|
ScriptableBattleStage |
time
Duration of the stage.
Declaration
public float time
Field Value
Type | Description |
---|---|
Single |
UIPrefab
Prefab that represents the image of the stage.
Declaration
public GameObject UIPrefab
Field Value
Type | Description |
---|---|
GameObject |
Methods
AllowFieldDrag(GameActor)
Sets the condition in which a GameActor can be moved.
Declaration
public abstract bool AllowFieldDrag(GameActor actor)
Parameters
Type | Name | Description |
---|---|---|
GameActor | actor | Actor to be dragged. |
Returns
Type | Description |
---|---|
Boolean | If a GameActor can be moved. |
ApplyBackupPlayerTeam(Int32)
Apply the Backup copy of the status of characters and items. Can be used to return to the previous state of a round, before making changes.
Declaration
protected bool ApplyBackupPlayerTeam(int PlayerIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | PlayerIndex |
Returns
Type | Description |
---|---|
Boolean |
BackupStagePlayerTeam(Int32)
Backup copy of the status of characters and items at the start of a stage. Can be used to return to the initial state of the stage, before making changes.
Declaration
protected void BackupStagePlayerTeam(int PlayerIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | PlayerIndex |
BackupStatePlayerTeam(Int32)
Backup copy of the status of characters and items. Can be used to return to the previous state of a round, before making changes.
Declaration
protected void BackupStatePlayerTeam(int PlayerIndex = 0)
Parameters
Type | Name | Description |
---|---|---|
Int32 | PlayerIndex |
CharacterAIUpdate(GameCharacter)
Every GameCharacter delegates the Update() method to this state.
Declaration
public abstract void CharacterAIUpdate(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character to be updated. |
OnStageStart()
Method that is invoked once the state starts.
Declaration
public abstract void OnStageStart()
OnTimerFinish()
Method that is called once when the Timer marks zero.
Declaration
public abstract void OnTimerFinish()
Update()
Method that is once every frame.
Declaration
public abstract void Update()