Table of Contents

Class WindroseAnimator

The performer responsible for playing windrose animations.

Namespace : SpriteAnimations

Fields

_currentDirection

The current direction in wich the animation is playing.

protected WindroseDirection _currentDirection

Field Value

WindroseDirection

_windroseAnimation

The windrose animation wich is currently associated with this performer

protected SpriteAnimationWindrose _windroseAnimation

Field Value

SpriteAnimationWindrose

Methods

EndAnimation()

protected void EndAnimation()

EndCycle()

Ends the current cycle. In case the animation is loopable, it restarts the cycle. Case the animation is not a loop, it ends the animation.

protected void EndCycle()

FromStart()

Resets the current animation cycle and starts playing the windrose animation from the start.

public WindroseAnimator FromStart()

Returns

WindroseAnimator

The updated WindroseAnimator instance.

ResetCycle()

Resets the current cycle.

protected void ResetCycle()

SetDirection(WindroseDirection, WindroseFlipStrategy)

Sets the direction of the animation.

public WindroseAnimator SetDirection(WindroseDirection direction, WindroseFlipStrategy flipStrategy = WindroseFlipStrategy.NoFlip)

Parameters

direction WindroseDirection

The direction to set.

flipStrategy WindroseFlipStrategy

The strategy to use when flipping the sprite.

Returns

WindroseAnimator

The updated WindroseAnimator instance.

SetDirection(Vector2, WindroseFlipStrategy)

Sets the direction of the animation.

public WindroseAnimator SetDirection(Vector2 movementInput, WindroseFlipStrategy flipStrategy = WindroseFlipStrategy.NoFlip)

Parameters

movementInput Vector2
flipStrategy WindroseFlipStrategy

The strategy to use when flipping the sprite.

Returns

WindroseAnimator

The updated WindroseAnimator instance.

SetDirection(Vector2Int, WindroseFlipStrategy)

Sets the direction of the animation.

public WindroseAnimator SetDirection(Vector2Int signedMovementInput, WindroseFlipStrategy flipStrategy = WindroseFlipStrategy.NoFlip)

Parameters

signedMovementInput Vector2Int
flipStrategy WindroseFlipStrategy

Returns

WindroseAnimator

The updated WindroseAnimator instance.

StartAnimation(SpriteAnimation)

Must be called to start playing an animation

public override void StartAnimation(SpriteAnimation animation)

Parameters

animation SpriteAnimation

StopAnimation()

Must be called every time the animation should be stopped.

public override void StopAnimation()

Tick(float)

Evaluates what frame should be displayed based on the current cycle. This also handles the animation cycles.

public override void Tick(float deltaTime)

Parameters

deltaTime float