Class GameCharacter
Game character that can move and battle with other characters.
Inherited Members
Namespace: AutoBattleFramework.BattleBehaviour.GameActors
Assembly: cs.temp.dll.dll
Syntax
public class GameCharacter : GameActor
Fields
agent
Reference to the navigation agent.
Declaration
public NavMeshAgent agent
Field Value
Type | Description |
---|---|
NavMeshAgent |
animator
Reference to the character animator.
Declaration
public Animator animator
Field Value
Type | Description |
---|---|
Animator |
attackEffect
Declaration
public IAttackEffect attackEffect
Field Value
Type | Description |
---|---|
IAttackEffect |
BuffList
List of the BuffEffect being applied on the character.
Declaration
public List<BuffEffectInfo> BuffList
Field Value
Type | Description |
---|---|
List<BuffEffectInfo> |
currentPath
List of GridCells that the character should follow to reach TargetGridCell.
Declaration
public List<GridCell> currentPath
Field Value
Type | Description |
---|---|
List<GridCell> |
CurrentStats
The stats currently in use during a battle.
Declaration
public CharacterStats CurrentStats
Field Value
Type | Description |
---|---|
CharacterStats |
EnemyShootingPoint
If recieving a Projectile, where should it aim to.
Declaration
public Transform EnemyShootingPoint
Field Value
Type | Description |
---|---|
Transform |
FaceEnemyTime
Time to look at the enemy.
Declaration
public float FaceEnemyTime
Field Value
Type | Description |
---|---|
Single |
HealthBarPrefab
Prebab of the health bar.
Declaration
public CharacterHealthUI HealthBarPrefab
Field Value
Type | Description |
---|---|
CharacterHealthUI |
InitialStats
Initials stats before a battle. Makes a save point of the character's statistics between rounds.
Declaration
public CharacterStats InitialStats
Field Value
Type | Description |
---|---|
CharacterStats |
itemModificators
List of itemModificator of items attached to the character.
Declaration
public List<ItemModificator> itemModificators
Field Value
Type | Description |
---|---|
List<ItemModificator> |
OffsetDamagePosition
Offset from UIBarPosition, where the damage will be shown.
Declaration
public Vector3 OffsetDamagePosition
Field Value
Type | Description |
---|---|
Vector3 |
OriginalStats
Original stats of the character. Stats of the character without any StatsModificator.
Declaration
public CharacterStats OriginalStats
Field Value
Type | Description |
---|---|
CharacterStats |
ProjectileShootingPoint
If the attackEffect shoots a Projectile, the point where the projectile should spawn.
Declaration
public Transform ProjectileShootingPoint
Field Value
Type | Description |
---|---|
Transform |
SpecialAttackEffect
Declaration
public IAttackEffect SpecialAttackEffect
Field Value
Type | Description |
---|---|
IAttackEffect |
StartingFightPosition
World position of the character before starting FightState.
Declaration
public Vector3 StartingFightPosition
Field Value
Type | Description |
---|---|
Vector3 |
State
Declaration
public GameCharacter.AIState State
Field Value
Type | Description |
---|---|
GameCharacter.AIState |
TargetEnemy
The current enemy target of the character.
Declaration
public GameCharacter TargetEnemy
Field Value
Type | Description |
---|---|
GameCharacter |
TargetGridCell
The GridCell where the character should go.
Declaration
public GridCell TargetGridCell
Field Value
Type | Description |
---|---|
GridCell |
TraitModificators
List of modificator being applied to the character.
Declaration
public List<StatsModificator> TraitModificators
Field Value
Type | Description |
---|---|
List<StatsModificator> |
traits
Declaration
public List<Trait> traits
Field Value
Type | Description |
---|---|
List<Trait> |
UIBarPosition
Declaration
public Transform UIBarPosition
Field Value
Type | Description |
---|---|
Transform |
Properties
DamageVisualOnly
The damage done by this character is only visual. It does not do damage or activate effects. In single player, the damage can�t be visual only.
Declaration
public virtual bool DamageVisualOnly { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AfterBought()
Perform a fusion check after being bought
Declaration
public override void AfterBought()
Overrides
ApplyTraitsToNewCharacter(List<Trait>)
Apply the traits effects to a recently bought character.
Declaration
public void ApplyTraitsToNewCharacter(List<Trait> traits)
Parameters
Type | Name | Description |
---|---|---|
List<Trait> | traits | List of traits. |
Attack()
Method that is triggered from the animation event. Performs a basic attack.
Declaration
public virtual void Attack()
Buy(GameActor)
Buys a character and places it on the Bench if there is enough space in it.
Declaration
public override GameActor Buy(GameActor shopItem)
Parameters
Type | Name | Description |
---|---|---|
GameActor | shopItem | Game character that will be bought. |
Returns
Type | Description |
---|---|
GameActor | Bought character. |
Overrides
CancelDrag()
Cancel the drag effect on the character.
Declaration
public void CancelDrag()
ChangeState(GameCharacter.AIState)
Change the state of the character and sets the animator variables.
Declaration
public void ChangeState(GameCharacter.AIState state)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter.AIState | state | State of the character. |
CreateDamagePopup(String, Color)
Creates a text that shows the damage infringed to another character.
Declaration
public virtual DamagePopup CreateDamagePopup(string text, Color color)
Parameters
Type | Name | Description |
---|---|---|
String | text | Number of the damage infringed. |
Color | color | Color of the text. |
Returns
Type | Description |
---|---|
DamagePopup | Damage text |
FaceTarget()
Make the character look at the current enemy.
Declaration
public void FaceTarget()
GetClosestCellDifferentToCurrent()
Returns the cell closest to the current CurrentGridCell, but different from the CurrentGridCell.
Declaration
public GridCell GetClosestCellDifferentToCurrent()
Returns
Type | Description |
---|---|
GridCell | Cell closest to the current cell, but different from the current cell. |
GetDamageColor(BattleFormulas.DamageType)
Get the color of the damage.
Declaration
public Color GetDamageColor(BattleFormulas.DamageType damageType)
Parameters
Type | Name | Description |
---|---|---|
BattleFormulas.DamageType | damageType | Type of damage infringed. |
Returns
Type | Description |
---|---|
Color | Color of the text damage. |
InAttackRange()
Check if the character is in range from its current enemy.
Declaration
public bool InAttackRange()
Returns
Type | Description |
---|---|
Boolean | If the character is in range from its current enemy. |
MoveCharacterTo(GridCell)
Force the movement of a character to a given cell.
Declaration
protected virtual void MoveCharacterTo(GridCell cell)
Parameters
Type | Name | Description |
---|---|---|
GridCell | cell | Cell where the character will move. |
NextMoveCell()
Returns the next cell where the character will move to.
Declaration
public GridCell NextMoveCell()
Returns
Type | Description |
---|---|
GridCell | Next cell where the character will move to |
OnDestroy()
Destroy the health bar when the character is destroyed.
Declaration
public override void OnDestroy()
OnDragObjectAction()
Allows the movement of the character between cells.
Declaration
public override void OnDragObjectAction()
Overrides
OnMouseDownAction()
Start the drag.
Declaration
public override void OnMouseDownAction()
Overrides
OnMouseOverAction()
When right click, show the character UI.
Declaration
public override void OnMouseOverAction()
Overrides
OnMouseUpAction()
Allows an character, to be moved within the TeamBenches, within the teams inside the battle grid, or to exchange its position with that of another character. In Android, if the character is dragged to the same cell, shows the description of the character.
Declaration
public override void OnMouseUpAction()
Overrides
Sell()
the character and gain currency.
Declaration
public override void Sell()
Overrides
SetVariablesOnSpawn(GameCharacter, IPlayer)
When spawned, apply traits, set state, and rotation.
Declaration
protected virtual void SetVariablesOnSpawn(GameCharacter character, IPlayer player = null)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character spawned. |
IPlayer | player | Multiplayer only. Player prefab in multiplayer. |
ShowUI(Boolean)
Shows the CharacterStatsUI that describes the character stats.
Declaration
public override GameObject ShowUI(bool show)
Parameters
Type | Name | Description |
---|---|---|
Boolean | show | Show or hide the UI |
Returns
Type | Description |
---|---|
GameObject | GameObject of the CharacterStatsUI. |
Overrides
ShowUIBar(Boolean)
Show or hide the AutoBattleFramework.BattleBehaviour.GameActors.GameCharacter.HealthBarInstance.
Declaration
public void ShowUIBar(bool value)
Parameters
Type | Name | Description |
---|---|---|
Boolean | value | Show or hide the bar. |
SpecialAttack()
Method that is activated from the animation event once the Energy reaches its maximum. Performs a special attack.
Declaration
public virtual void SpecialAttack()
Start()
Declaration
protected void Start()
SwapCharactersInCells(GridCell, GridCell)
Swap the position of two characters in the BattleGrid.
Declaration
protected void SwapCharactersInCells(GridCell c1, GridCell c2)
Parameters
Type | Name | Description |
---|---|---|
GridCell | c1 | Cell of the first character. |
GridCell | c2 | Cell of the second character. |
UnequipItemModificator(Int32)
Unequips an item's modifier.
Declaration
public virtual void UnequipItemModificator(int itemModificatorIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | itemModificatorIndex | Index of the item modificator. |
Update()
Declaration
protected virtual void Update()