AttackDirectionCore
A class in Root.Township, Alta.Intelligence.
Drives an agent's attack-direction animations (a layer weight plus side and up directions) from where its target's attacks come from. Made by AttackDirectionCoreSettings and updated each frame.
- Listed in Creatures and AI
Constructors
| Member | What it is |
|---|---|
AttackDirectionCore(AttackDirectionCoreSettings settings, IAgent topic) | Creates an AttackDirectionCore from settings and topic. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private float lastAttackFade | Real time until which the current direction is held after the last attack seen. |
private IAttackDirectionAnimation layer | Animation that turns the attack-direction layer on or off. |
private AttackDirectionCoreSettings settings | The settings this core was made from. |
private IAttackDirectionAnimation side | Animation for a left or right attack direction. |
private IAttackDirectionAnimation up | Animation for an attack coming from above. |
Methods
| Member | What it is |
|---|---|
void Disable(IAgent topic) | Disables the three animations and clears the agent's target facing if the settings made it face the target. |
void Update(IAgent topic) | Finds the target's strongest attack above the minimum damage and sets the side or up direction from where it comes. Fades back to neutral half a second after attacks stop. |
1 private and internal method
| Member | What it is |
|---|---|
private IAttackDirectionAnimation GetAnimation(AttackDirectionAnimationSettings settings, IAgent topic) | Makes the animation for one settings entry on the agent's network animator, or an empty one if the entry is unset. |
Used in
Members of other types that take, return or hold a AttackDirectionCore: