Table of Contents

Class SpriteAnimation

The base class for all Animations

Namespace : SpriteAnimations

Fields

_animationName

The animation name to be used by the SpriteAnimator

[SerializeField]
protected string _animationName

Field Value

string

_fps

Amount of frames per second.

[SerializeField]
protected int _fps

Field Value

int

Properties

AnimationName

The name of the animation. Can be used to identify the animation in the SpriteAnimator.

public string AnimationName { get; set; }

Property Value

string

AnimationType

public abstract AnimationType AnimationType { get; }

Property Value

AnimationType

FPS

The amount of frames per second.

public int FPS { get; set; }

Property Value

int

PerformerType

public abstract Type PerformerType { get; }

Property Value

Type

Methods

CalculateDuration()

Calculates the duration of the animation in seconds. Depending on the type of animation this can have serious perfomance impacts as it has to evaluate all frames of all the animation cycles.

public float CalculateDuration()

Returns

float

The duration of the animation in seconds.

CalculateFramesCount()

Calculates the total amount of frames in the animation. Depending on the type of animation this can have serious perfomance impacts as it has to evaluate all frames of all the animation cycles.

public abstract int CalculateFramesCount()

Returns

int

The count of frames.

Events

NameChanged

Listen to this event to be notified when the animation name changes

public event NameChangedEvent NameChanged

Event Type

NameChangedEvent