Class EchoMotionProxy<TItem>
- Namespace
- FriedSynapse.FlowEnt
Wrapper class that is used to apply motions to an object of any type using a echo
public class EchoMotionProxy<TItem>
Type Parameters
TItem
- Inheritance
-
EchoMotionProxy<TItem>
- Inherited Members
- Extension Methods
Constructors
EchoMotionProxy(Echo, TItem)
public EchoMotionProxy(Echo echo, TItem item)
Parameters
echo
Echoitem
TItem
Properties
Echo
public Echo Echo { get; }
Property Value
Item
public TItem Item { get; }
Property Value
- TItem
Methods
Apply(params AbstractEchoMotion[])
Applies all the motions to the current echo.
public EchoMotionProxy<TItem> Apply(params AbstractEchoMotion[] motions)
Parameters
motions
AbstractEchoMotion[]
Returns
- EchoMotionProxy<TItem>
Apply(IEnumerable<AbstractEchoMotion>)
Applies all the motions to the current echo.
public EchoMotionProxy<TItem> Apply(IEnumerable<AbstractEchoMotion> motions)
Parameters
motions
IEnumerable<AbstractEchoMotion>
Returns
- EchoMotionProxy<TItem>
AsAsync()
Provides a task that can be awaited. The task completes when the animation ends.
public Task AsAsync()
Returns
ForAll<TItem2>(IEnumerable<TItem2>)
Creates a scope for the object so you can add motions designed specifically for that enumeration of objects.
public EchoMotionProxyArray<TItem2> ForAll<TItem2>(IEnumerable<TItem2> elements) where TItem2 : class
Parameters
elements
IEnumerable<TItem2>
Returns
- EchoMotionProxyArray<TItem2>
Type Parameters
TItem2
For<TItem2>(TItem2)
Creates a scope for the object so you can add motions designed specifically for that object.
public EchoMotionProxy<TItem2> For<TItem2>(TItem2 item) where TItem2 : class
Parameters
item
TItem2
Returns
- EchoMotionProxy<TItem2>
Type Parameters
TItem2
For<TItem2>(params TItem2[])
Creates a scope for the object so you can add motions designed specifically for that array of objects.
public EchoMotionProxyArray<TItem2> For<TItem2>(params TItem2[] elements) where TItem2 : class
Parameters
elements
TItem2[]
Returns
- EchoMotionProxyArray<TItem2>
Type Parameters
TItem2
OnCompleted(Action)
Adds an event called when the animation has completed.
public EchoMotionProxy<TItem> OnCompleted(Action callback)
Parameters
callback
ActionThe event.
Returns
- EchoMotionProxy<TItem>
OnCompleting(Action)
Adds an event called when the animation is completing.
public EchoMotionProxy<TItem> OnCompleting(Action callback)
Parameters
callback
ActionThe event.
Returns
- EchoMotionProxy<TItem>
OnLoopCompleted(Action<int?>)
Adds an event called when the animation loop has completed.
public EchoMotionProxy<TItem> 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
- EchoMotionProxy<TItem>
OnLoopStarted(Action<int?>)
Adds an event called when the animation loop has started.
public EchoMotionProxy<TItem> 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
- EchoMotionProxy<TItem>
OnStarted(Action)
Adds an event called when the animation has started.
public EchoMotionProxy<TItem> OnStarted(Action callback)
Parameters
callback
ActionThe event.
Returns
- EchoMotionProxy<TItem>
OnStarting(Action)
Adds an event called when the animation is starting.
public EchoMotionProxy<TItem> OnStarting(Action callback)
Parameters
callback
ActionThe event.
Returns
- EchoMotionProxy<TItem>
OnUpdated(Action<float>)
Adds an event called when the animation has updated.
public EchoMotionProxy<TItem> OnUpdated(Action<float> callback)
Parameters
Returns
- EchoMotionProxy<TItem>
OnUpdating(Action<float>)
Adds an event called when the animation is updating.
public EchoMotionProxy<TItem> OnUpdating(Action<float> callback)
Parameters
Returns
- EchoMotionProxy<TItem>
Pause()
Pauses the animation.
public EchoMotionProxy<TItem> Pause()
Returns
- EchoMotionProxy<TItem>
Reset()
Resets the animation so in can be replayed.
public EchoMotionProxy<TItem> Reset()
Returns
- EchoMotionProxy<TItem>
Exceptions
- AnimationException
If the animation is not finished.
- AnimationException
If the echo is not finished.
Resume()
Resumes the animation.
public EchoMotionProxy<TItem> Resume()
Returns
- EchoMotionProxy<TItem>
SetAutoStart(bool)
Sets whether this animation should auto-start or not.
public EchoMotionProxy<TItem> SetAutoStart(bool autoStart)
Parameters
autoStart
bool
Returns
- EchoMotionProxy<TItem>
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 EchoMotionProxy<TItem> SetDelay(float time)
Parameters
time
float
Returns
- EchoMotionProxy<TItem>
SetDelayUntil(Func<bool>)
Sets the callback that holds the starting of the animation.
public EchoMotionProxy<TItem> SetDelayUntil(Func<bool> callback)
Parameters
Returns
- EchoMotionProxy<TItem>
SetLoopCount(int?)
Sets the amount of loops you want this animation to have. If you want infinite loops pass a null value.
public EchoMotionProxy<TItem> SetLoopCount(int? loopCount)
Parameters
loopCount
int?
Returns
- EchoMotionProxy<TItem>
Remarks
Flows only have reset loop types.
SetName(string)
Sets the name of the animation.
public EchoMotionProxy<TItem> SetName(string name)
Parameters
name
string
Returns
- EchoMotionProxy<TItem>
SetSkipFrames(int)
Sets the amount of frames you want to skip at when this animation is started.
public EchoMotionProxy<TItem> SetSkipFrames(int frames)
Parameters
frames
int
Returns
- EchoMotionProxy<TItem>
SetStopCondition(Func<float, bool>)
Sets the condition that when true, it will stop the echo.
public EchoMotionProxy<TItem> SetStopCondition(Func<float, bool> stopCondition)
Parameters
Returns
- EchoMotionProxy<TItem>
SetTimeScale(float)
Sets the time scale for the current animation.
public EchoMotionProxy<TItem> SetTimeScale(float timeScale)
Parameters
timeScale
float
Returns
- EchoMotionProxy<TItem>
SetTimeout(float?)
Sets the amount of time in seconds that this echo will last.
public EchoMotionProxy<TItem> SetTimeout(float? timeout)
Parameters
timeout
float?
Returns
- EchoMotionProxy<TItem>
SetUpdateType(UpdateType)
Sets the update type for the animation.
public EchoMotionProxy<TItem> SetUpdateType(UpdateType updateType)
Parameters
updateType
UpdateType
Returns
- EchoMotionProxy<TItem>
Start()
Starts the animation.
public EchoMotionProxy<TItem> Start()
Returns
- EchoMotionProxy<TItem>
Exceptions
- AnimationException
If the echo has already started.
StartAsync(CancellationToken?)
Starts the animation async(you can await this till the animation finishes).
public Task<EchoMotionProxy<TItem>> 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<EchoMotionProxy<TItem>>
Exceptions
- AnimationException
If the echo has already started.
Stop(bool)
Stops the animation.
public EchoMotionProxy<TItem> Stop(bool triggerOnCompleted = false)
Parameters
triggerOnCompleted
boolIf set to true will trigger the "OnCompleted" event on the animation
Returns
- EchoMotionProxy<TItem>
Operators
implicit operator Echo(EchoMotionProxy<TItem>)
public static implicit operator Echo(EchoMotionProxy<TItem> proxy)
Parameters
proxy
EchoMotionProxy<TItem>