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
_windroseAnimation
The windrose animation wich is currently associated with this performer
protected SpriteAnimationWindrose _windroseAnimation
Field Value
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
WindroseDirectionThe direction to set.
flipStrategy
WindroseFlipStrategyThe 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
Vector2flipStrategy
WindroseFlipStrategyThe 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
Vector2IntflipStrategy
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