AttackState Class

Summary

A Animancer.Examples.StateMachines.Platformer.CreatureState that performs an attack animation then returns to idle.
graph BT Type-->Base0["CreatureState"] click Base0 "/animancer/api/Animancer.Examples.StateMachines.Platformer/CreatureState" Base0-->Base1["StateBehaviour<CreatureState>"] Base1-->Base2["MonoBehaviour"] Type-.->Interface0["IOwnedState<CreatureState>"] Type-.->Interface1["IState<CreatureState>"] Type["AttackState"] class Type type-node

Syntax

[AddComponentMenu(Strings.ExamplesMenuPrefix + "Platformer - Attack State")]
[HelpURL(Strings.DocsURLs.ExampleAPIDocumentation + nameof(StateMachines) + "." + nameof(Platformer) + "/" + nameof(AttackState))]
public sealed class AttackState : CreatureState, IOwnedState<CreatureState>, IState<CreatureState>

Examples

Platformer

Attributes

Type Description
AddComponentMenu
HelpURLAttribute

Properties

Name Value Summary
Creature Creature
The Examples.PlatformerCreature that owns this state.
Inherited from CreatureState
MovementSpeed float
The current speed at which this state allows the creature to move.
Inherited from CreatureState
OwnerStateMachine StateMachine<CreatureState>
The Animancer.FSM.StateMachine`1 that this state is used in.
Inherited from CreatureState

Methods

Name Value Summary
CanExitState(CreatureState) bool
Returns false so that nothing can interript an attack until it is done.
SetCreature(Creature) void
Sets the Animancer.Examples.StateMachines.Platformer.CreatureState.Creature.
Inherited from CreatureState