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
_fps
Amount of frames per second.
[SerializeField]
protected int _fps
Field Value
Properties
AnimationName
The name of the animation. Can be used to identify the animation in the SpriteAnimator.
public string AnimationName { get; set; }
Property Value
AnimationType
public abstract AnimationType AnimationType { get; }
Property Value
FPS
The amount of frames per second.
public int FPS { get; set; }
Property Value
PerformerType
public abstract Type PerformerType { get; }
Property Value
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