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