API Reference

Class List

AnimComponentLayer

The Anim Component Layer allows managers a single layer of the animation state graph.

Summary

Properties

activeState

Returns the currently active state name.[read only]

activeStateCurrentTime

The active states time in seconds.

activeStateDuration

Returns the currently active states duration.[read only]

activeStateProgress

Returns the currently active states progress as a value normalised by the states animation duration.[read only]

name

Returns the name of the layer.[read only]

playable

Returns true if a state graph has been loaded and all states in the graph have been assigned animation tracks.[read only]

playing

Whether this layer is currently playing.

previousState

Returns the previously active state name.[read only]

states

Lists all available states in this layers state graph.[read only]

transitionProgress

If the anim component layer is currently transitioning between states, returns the progress.[read only]

transitioning

Returns whether the anim component layer is currently transitioning between states.[read only]

Methods

assignAnimation

Associates an animation with a state node in the loaded state graph.

pause

Start playing the animation in the current state.

play

Start playing the animation in the current state.

rebind

Rebind any animations in the layer to the currently present components and model of the anim components entity.

removeNodeAnimations

Removes animations from a node in the loaded state graph.

reset

Reset the animation component to it's initial state, including all parameters.

Details

Constructor

AnimComponentLayer(name, controller, component)

Create a new AnimComponentLayer.

Parameters

namestring

The name of the layer.

controllerobject

The controller to manage this layers animations.

componentAnimComponent

The component that this layer is a member of.

Properties

stringactiveState

Returns the currently active state name.

[read only]

numberactiveStateCurrentTime

The active states time in seconds.

numberactiveStateDuration

Returns the currently active states duration.

[read only]

numberactiveStateProgress

Returns the currently active states progress as a value normalised by the states animation duration. Looped animations will return values greater than 1.

[read only]

stringname

Returns the name of the layer.

[read only]

stringplayable

Returns true if a state graph has been loaded and all states in the graph have been assigned animation tracks.

[read only]

stringplaying

Whether this layer is currently playing.

stringpreviousState

Returns the previously active state name.

[read only]

string[]states

Lists all available states in this layers state graph.

[read only]

numbertransitionProgress

If the anim component layer is currently transitioning between states, returns the progress. Otherwise returns null.

[read only]

booleantransitioning

Returns whether the anim component layer is currently transitioning between states.

[read only]

Methods

assignAnimation(nodeName, animTrack)

Associates an animation with a state node in the loaded state graph. If all states nodes are linked and the AnimComponent#activate value was set to true then the component will begin playing.

Parameters

nodeNamestring

The name of the node that this animation should be associated with.

animTrackobject

The animation track that will be assigned to this state and played whenever this state is active.

pause()

Start playing the animation in the current state.

play([name])

Start playing the animation in the current state.

Parameters

namestring

If provided, will begin playing from the start of the state with this name.

rebind()

Rebind any animations in the layer to the currently present components and model of the anim components entity.

removeNodeAnimations(nodeName)

Removes animations from a node in the loaded state graph.

Parameters

nodeNamestring

The name of the node that should have its animation tracks removed.

reset()

Reset the animation component to it's initial state, including all parameters. The system will be paused.