Skip to main content

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.

Constructors​

MemberWhat it is
AttackDirectionCore(AttackDirectionCoreSettings settings, IAgent topic)Creates an AttackDirectionCore from settings and topic.

Fields​

5 private and internal fields
MemberWhat it is
private float lastAttackFadeReal time until which the current direction is held after the last attack seen.
private IAttackDirectionAnimation layerAnimation that turns the attack-direction layer on or off.
private AttackDirectionCoreSettings settingsThe settings this core was made from.
private IAttackDirectionAnimation sideAnimation for a left or right attack direction.
private IAttackDirectionAnimation upAnimation for an attack coming from above.

Methods​

MemberWhat 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
MemberWhat 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: