Unit Sub-Components

There are optional Unit Sub-Components and the idea behind this is to be able to leave out stuff that is not needed. The naming of sub-components is designed so that one can say: "a unit can [subcomponent name]"

An example for Units that do not need any Sub-Components are Units that represent regular Items.

Unit Sub-Components List:

diagram

receiveCommand:

receiveCommand adds to the unit:

  • CommandQueue

  • Behavior Graph

The builtin command is "Die" and that means that a unit without the receiveCommand component will (not receive damage and will) not die.

This component also observes Unit’s IsDead flag and if this becomes true AND the Unit is not unkillable, the "Die" command will be issued.

This also requires an Animator

moveSelf:

requires: receiveCommand

Adds: NavMeshAgent, MoveToClickPoint

beMoved

can be moved by forces from outside. While the unit is UNSTOPPABLE, this will be switched off.

Requires: Rigidbody???

autoAttack:

can auto attack. The auto attack itself is determined by the unit’s weapon.

requires: receiveCommand, a Weapon, an attack animation, a FirePoint.

cast:

can cast. What the unit can cast is determined by its Abilities.

REQUIRES: receiveCommand, FirePoint, castable Ability.

showFloatingText

can display popup Text that indicates damage, healing and status effects.

beConsumed

this is for Powerups, e.g. for Items that should be consumed when the unit walks over them.

This is not for potion-like mechanics.

REQUIRES: To be an Item with an EffectInstant

beTargeted

Can be the target of an ability-cast, autoattack, or the result of a search area effect.

REQUIRES: Collider (for mouse enter, exit), Hitpoint, HoverableOutline

beSelected

REQUIRES: HoverableOutline

playAudio

has an audio source

REQUIRES: audio source

displayLocalUI

can display e.g. a healthbar over its head.

As the default localUI includes a castbar, displayLocalUI requires receiveCommand.

interact

can use other unit’s interact ability

REQUIRES: Interactor collider