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
directionWindroseDirectionThe direction to set.
flipStrategyWindroseFlipStrategyThe 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
movementInputVector2flipStrategyWindroseFlipStrategyThe 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
signedMovementInputVector2IntflipStrategyWindroseFlipStrategy
Returns
- WindroseAnimator
The updated WindroseAnimator instance.
StartAnimation(SpriteAnimation)
Must be called to start playing an animation
public override void StartAnimation(SpriteAnimation animation)
Parameters
animationSpriteAnimation
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
deltaTimefloat