Table of Contents

Class AbstractAnimation

Provides animation specific behaviour

public abstract class AbstractAnimation : AbstractUpdatable, IControllable
Inheritance
AbstractAnimation
Implements
Derived
Inherited Members
Extension Methods

Constructors

AbstractAnimation()

Creates a new instance using FlowEntController.

protected AbstractAnimation()

Properties

AutoStart

public bool AutoStart { get; protected set; }

Property Value

bool

Controllable

Returns the current animation cast as IControllable, which can be used to control the animation

public IControllable Controllable { get; }

Property Value

IControllable

Overdraft

THe amount of scaled time unconsumed by this animation from the last frame.

public float? Overdraft { get; }

Property Value

float?

PlayState

The current state of the animation.

public PlayState PlayState { get; }

Property Value

PlayState

TimeScale

public float TimeScale { get; set; }

Property Value

float

UpdateType

public UpdateType UpdateType { get; set; }

Property Value

UpdateType

Methods

AsAsync(CancellationToken?)

Provides a task that can be awaited. The task completes when the animation ends.

public Task AsAsync(CancellationToken? token = null)

Parameters

token CancellationToken?

Returns

Task

Conditional(Func<bool>, Action<AbstractAnimation>)

Executes the onConditionTrue if condition returns true.

public AbstractAnimation Conditional(Func<bool> condition, Action<AbstractAnimation> onConditionTrue)

Parameters

condition Func<bool>

The condition.

onConditionTrue Action<AbstractAnimation>

The callback.

Returns

AbstractAnimation

ConditionalInternal<TAnimation>(Func<bool>, Action<TAnimation>)

Executes the onConditionTrue if condition returns true.

protected TAnimation ConditionalInternal<TAnimation>(Func<bool> condition, Action<TAnimation> onConditionTrue) where TAnimation : AbstractAnimation

Parameters

condition Func<bool>

The condition.

onConditionTrue Action<TAnimation>

The callback.

Returns

TAnimation

Type Parameters

TAnimation

OnCompleted(Action)

Adds an event called when the animation has completed.

public AbstractAnimation OnCompleted(Action callback)

Parameters

callback Action

The event.

Returns

AbstractAnimation

OnCompleting(Action)

Adds an event called when the animation is completing.

public AbstractAnimation OnCompleting(Action callback)

Parameters

callback Action

The event.

Returns

AbstractAnimation

OnLoopCompleted(Action<int?>)

Adds an event called when the animation loop has completed.

public AbstractAnimation OnLoopCompleted(Action<int?> callback)

Parameters

callback Action<int?>

The event. The parameter represents the number of loops left. If there are infinite loops it'll send a null param.

Returns

AbstractAnimation

OnLoopStarted(Action<int?>)

Adds an event called when the animation loop has started.

public AbstractAnimation OnLoopStarted(Action<int?> callback)

Parameters

callback Action<int?>

The event. The parameter represents the number of loops left. If there are infinite loops it'll send a null param.

Returns

AbstractAnimation

OnStarted(Action)

Adds an event called when the animation has started.

public AbstractAnimation OnStarted(Action callback)

Parameters

callback Action

The event.

Returns

AbstractAnimation

OnStarting(Action)

Adds an event called when the animation is starting.

public AbstractAnimation OnStarting(Action callback)

Parameters

callback Action

The event.

Returns

AbstractAnimation

OnUpdated(Action<float>)

Adds an event called when the animation has updated.

public AbstractAnimation OnUpdated(Action<float> callback)

Parameters

callback Action<float>

The event.

Returns

AbstractAnimation

OnUpdating(Action<float>)

Adds an event called when the animation is updating.

public AbstractAnimation OnUpdating(Action<float> callback)

Parameters

callback Action<float>

The event.

Returns

AbstractAnimation

Pause()

Pauses the animation.

public AbstractAnimation Pause()

Returns

AbstractAnimation

Reset()

Resets the animation so in can be replayed.

public AbstractAnimation Reset()

Returns

AbstractAnimation

Exceptions

AnimationException

If the animation is not finished.

ResetInternal()

protected override void ResetInternal()

Resume()

Resumes the animation.

public AbstractAnimation Resume()

Returns

AbstractAnimation

SetAutoStart(bool)

Sets whether this animation should auto-start or not.

public AbstractAnimation SetAutoStart(bool autoStart)

Parameters

autoStart bool

Returns

AbstractAnimation

Remarks

Auto-start will be slower than a true-start. See more at https://flowent.friedsynapse.com/tips#h.s5cucrg5qyjc

SetDelay(float)

Sets the amount of time in seconds that you want to delay when this animation is started.

public AbstractAnimation SetDelay(float time)

Parameters

time float

Returns

AbstractAnimation

SetDelayUntil(Func<bool>)

Sets the callback that holds the starting of the animation.

public AbstractAnimation SetDelayUntil(Func<bool> callback)

Parameters

callback Func<bool>

Returns

AbstractAnimation

SetEvents(AbstractAnimationEvents)

protected void SetEvents(AbstractAnimationEvents events)

Parameters

events AbstractAnimationEvents

SetLoopCount(int?)

Sets the amount of loops you want this animation to have. If you want infinite loops pass a null value.

public AbstractAnimation SetLoopCount(int? loopCount)

Parameters

loopCount int?

Returns

AbstractAnimation

Remarks

Flows only have reset loop types.

SetName(string)

Sets the name of the animation.

public AbstractAnimation SetName(string name)

Parameters

name string

Returns

AbstractAnimation

SetOptions(AbstractAnimationOptions)

protected void SetOptions(AbstractAnimationOptions options)

Parameters

options AbstractAnimationOptions

SetSkipFrames(int)

Sets the amount of frames you want to skip at when this animation is started.

public AbstractAnimation SetSkipFrames(int frames)

Parameters

frames int

Returns

AbstractAnimation

SetTimeScale(float)

Sets the time scale for the current animation.

public AbstractAnimation SetTimeScale(float timeScale)

Parameters

timeScale float

Returns

AbstractAnimation

SetUpdateType(UpdateType)

Sets the update type for the animation.

public AbstractAnimation SetUpdateType(UpdateType updateType)

Parameters

updateType UpdateType

Returns

AbstractAnimation

Start()

Starts the animation.

public AbstractAnimation Start()

Returns

AbstractAnimation

StartAsync(CancellationToken?)

Starts the animation async(you can await this till the animation finishes).

public Task<AbstractAnimation> StartAsync(CancellationToken? token = null)

Parameters

token CancellationToken?

The cancellation doesn't cancel the task, but rather terminates the animation. The task will be completed

Returns

Task<AbstractAnimation>

Stop(bool)

Stops the animation.

public AbstractAnimation Stop(bool triggerOnCompleted = false)

Parameters

triggerOnCompleted bool

If set to true will trigger the "OnCompleted" event on the animation

Returns

AbstractAnimation

StopInternal(bool)

protected override void StopInternal(bool triggerOnCompleted)

Parameters

triggerOnCompleted bool