Skip to main content

AttackDirectionCoreSettings

A class in Root.Township, Alta.Intelligence.

Settings asset that makes a creature animate in response to where its target is attacking from (above or either side). GetCore makes the runtime AttackDirectionCore.

  • Listed in Creatures and AI
  • Inherits or implements ScriptableObject
  • Attributes CreateAssetMenu

Constructors​

MemberWhat it is
AttackDirectionCoreSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

7 private and internal fields
MemberWhat it is
private float animationChangeDurationSeconds to blend the reaction animations to a new direction.
private float heightHeight above the target's ground position used to judge where an attack comes from.
private bool isFacingTargetWhether the agent turns to face its target while this runs.
private AttackDirectionAnimationSettings layerAnimation that switches the reaction layer on while an attack is incoming.
private float minDamageAttacks at or below this damage are ignored.
private AttackDirectionAnimationSettings sideAnimation for attacks coming from the left or right.
private AttackDirectionAnimationSettings upAnimation for attacks coming from above.

Properties​

MemberWhat it is
float AnimationChangeDuration { get; }Seconds to blend the direction animations to a new value.
float Height { get; }Height above the target's ground position used as the reference point for attack directions.
bool IsFacingTarget { get; }If true the creature turns to face its target while the core runs.
AttackDirectionAnimationSettings Layer { get; }Animation switched on whenever an attack above MinDamage is seen.
float MinDamage { get; }Target attacks with damage below this are ignored.
AttackDirectionAnimationSettings Side { get; }Animation set left or right for attacks from the side.
AttackDirectionAnimationSettings Up { get; }Animation set for attacks from above.

Methods​

MemberWhat it is
AttackDirectionCore GetCore(IAgent topic)Creates an AttackDirectionCore for the agent, which drives the three animations each update.

Used in​

Members of other types that take, return or hold a AttackDirectionCoreSettings: