2 using System.Collections.Generic;
15 [SerializeReference]
public List<ISimpleAnimation>
animations;
25 Debug.LogWarning($
"Trying to get the animation with index '{index}' of the 'SimpleAnimationsManager' of the GameObject {gameObject.name} but the size of the array is {animations.Count}.", gameObject);
38 if (
string.Compare(animation.
name, animationName, StringComparison.Ordinal) == 0)
41 Debug.LogWarning($
"Trying to find the animation with name '{animationName}' but it is not found in the 'SimpleAnimationsManager' of the GameObject {gameObject.name}", gameObject);
75 public void Play(
string animationName,
bool resume =
false)
85 public void Play(
int index,
bool resume =
false)
104 public void Play(
string animationName)
122 public void Stop(
string animationName)
131 List<SimpleAnimation> tempAnimToStop =
new List<SimpleAnimation>(
animationsToStop);
141 if (animation.
Step(Time.deltaTime))
Base interface to create simple animations of any element.
Base class to create simple animations of any element.
void Reset()
Sets the time stamps of the animation to the beginning (the behaviour changes depending on if the ani...
string name
The name of the animation
virtual void SetProgress(float progress)
Sets the animation at the given progress.
virtual bool Step(float deltaTime, bool inverseIfMirror=true)
Go forward or backwards in the animation.
Component used to control the behaviour of any SimpleAnimation
SimpleAnimation GetAnimation(int index)
Obtain an animation configured trough the inspector and stored in the SimpleAnimationsManager's memor...
SimpleAnimation GetAnimation(string animationName)
Returns the simple animation stored in this SimpleAnimationsManager witht he same name as the given.
void Play(SimpleAnimation animation, bool resume=false)
Starts playing the animation.
void Play(int index, bool resume=false)
Starts playing the animation.
HashSet< SimpleAnimation > animationsToStop
List of all the animations that should stopped so they will be removed from the "playingAnimations" l...
void Play(string animationName)
Starts playing the animation.
void Stop(int index)
Stops playing the animation.
void SetProgress(int index, float progress)
Sets the animation at the given progress.
void SetProgress(SimpleAnimation animation, float progress)
Sets the animation at the given progress.
void Play(string animationName, bool resume=false)
Starts playing the animation.
void SetProgress(string animationName, float progress)
Sets the animation at the given progress.
HashSet< SimpleAnimation > playingAnimations
List of all the animations that are being played.
List< ISimpleAnimation > animations
List of all the animations meant to be configured trough the inspector and/or stored in the SimpleAni...
void Stop(string animationName)
Stops playing the animation.
void Stop(SimpleAnimation animation)
Stops playing the animation.