DOTween  0.8.530
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
TweenSettingsExtensions Class Reference

Methods that extend Tween objects and allow to set their parameters More...

Static Public Member Functions

static T SetAutoKill< T > (this T t)
 Sets the autoKill behaviour of the tween. Has no effect if the tween has already started More...
 
static T SetAutoKill< T > (this T t, bool autoKillOnCompletion)
 Sets the autoKill behaviour of the tween. Has no effect if the tween has already started More...
 
static T SetId< T > (this T t, object id)
 Sets an ID for the tween, which can then be used as a filter with DOTween's static methods. More...
 
static T SetTarget< T > (this T t, object target)
 Sets the target for the tween, which can then be used as a filter with DOTween's static methods. More...
 
static T SetLoops< T > (this T t, int loops)
 Sets the looping options for the tween. Has no effect if the tween has already started More...
 
static T SetLoops< T > (this T t, int loops, LoopType loopType)
 Sets the looping options for the tween. Has no effect if the tween has already started More...
 
static T SetRecyclable< T > (this T t)
 Allows the tween to be recycled after being killed. More...
 
static T SetRecyclable< T > (this T t, bool recyclable)
 Sets the recycling behaviour for the tween. More...
 
static T SetUpdate< T > (this T t, bool isIndependentUpdate)
 Sets the update type to UpdateType.Default and lets you choose if it should be independent from Unity's Time.timeScale More...
 
static T SetUpdate< T > (this T t, UpdateType updateType, bool isIndependentUpdate=false)
 Sets the type of update (default or independent) for the tween More...
 
static T OnStart< T > (this T t, TweenCallback action)
 Sets the onStart callback for the tween. Called the first time the tween is set in a playing state, after any eventual delay More...
 
static T OnPlay< T > (this T t, TweenCallback action)
 Sets the onPlay callback for the tween. Called when the tween is set in a playing state, after any eventual delay. Also called each time the tween resumes playing from a paused state More...
 
static T OnRewind< T > (this T t, TweenCallback action)
 Sets the onRewind callback for the tween. Called when the tween is rewinded, either by calling More...
 
static T OnUpdate< T > (this T t, TweenCallback action)
 Sets the onUpdate callback for the tween. Called each time the tween updates More...
 
static T OnStepComplete< T > (this T t, TweenCallback action)
 Sets the onStepComplete callback for the tween. Called the moment the tween completes one loop cycle, even when going backwards More...
 
static T OnComplete< T > (this T t, TweenCallback action)
 Sets the onComplete callback for the tween. Called the moment the tween reaches its final forward position, loops included More...
 
static T OnKill< T > (this T t, TweenCallback action)
 Sets the onKill callback for the tween. Called the moment the tween is killed More...
 
static T SetAs< T > (this T t, Tween asTween)
 Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given one. Doesn't copy specific SetOptions settings: those will need to be applied manually each time. More...
 
static T SetAs< T > (this T t, TweenParms tweenParms)
 Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given TweenParms. More...
 
static Sequence Append (this Sequence s, Tween t)
 Adds the given tween to the end of the Sequence. Has no effect if the Sequence has already started More...
 
static Sequence Prepend (this Sequence s, Tween t)
 Adds the given tween to the beginning of the Sequence, pushing forward the other nested content. Has no effect if the Sequence has already started More...
 
static Sequence Insert (this Sequence s, float atPosition, Tween t)
 Inserts the given tween at the given time position in the Sequence, automatically adding an interval if needed. Has no effect if the Sequence has already started More...
 
static Sequence AppendInterval (this Sequence s, float interval)
 Adds the given interval to the end of the Sequence. Has no effect if the Sequence has already started More...
 
static Sequence PrependInterval (this Sequence s, float interval)
 Adds the given interval to the beginning of the Sequence, pushing forward the other nested content. Has no effect if the Sequence has already started More...
 
static Sequence AppendCallback (this Sequence s, TweenCallback callback)
 Adds the given callback to the end of the Sequence. Has no effect if the Sequence has already started More...
 
static Sequence PrependCallback (this Sequence s, TweenCallback callback)
 Adds the given callback to the beginning of the Sequence, pushing forward the other nested content. Has no effect if the Sequence has already started More...
 
static Sequence InsertCallback (this Sequence s, float atPosition, TweenCallback callback)
 Inserts the given callback at the given time position in the Sequence, automatically adding an interval if needed. Has no effect if the Sequence has already started More...
 
static T From< T > (this T t)
 Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue then immediately sends the target to the previously set endValue. More...
 
static T From< T > (this T t, bool isRelative)
 Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue then immediately sends the target to the previously set endValue. More...
 
static T SetDelay< T > (this T t, float delay)
 Sets a delayed startup for the tween. More...
 
static T SetRelative< T > (this T t)
 Sets the tween as relative (the endValue will be calculated as More...
 
static T SetRelative< T > (this T t, bool isRelative)
 If isRelative is TRUE sets the tween as relative (the endValue will be calculated as More...
 
static T SetSpeedBased< T > (this T t)
 If isSpeedBased is TRUE sets the tween as speed based (the duration will represent the number of units the tween moves x second). More...
 
static T SetSpeedBased< T > (this T t, bool isSpeedBased)
 If isSpeedBased is TRUE sets the tween as speed based (the duration will represent the number of units the tween moves x second). More...
 
static T SetEase< T > (this T t, Ease ease)
 Sets the ease of the tween. More...
 
static T SetEase< T > (this T t, Ease ease, float overshoot)
 Sets the ease of the tween. More...
 
static T SetEase< T > (this T t, Ease ease, float amplitude, float period)
 Sets the ease of the tween. More...
 
static T SetEase< T > (this T t, AnimationCurve animCurve)
 Sets the ease of the tween using an AnimationCurve. More...
 
static T SetEase< T > (this T t, EaseFunction customEase)
 Sets the ease of the tween using a custom ease function. More...
 
static Tweener SetOptions (this TweenerCore< float, float, FloatOptions > t, bool snapping)
 Options for float tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector2, Vector2, VectorOptions > t, bool snapping)
 Options for Vector2 tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector2, Vector2, VectorOptions > t, AxisConstraint axisConstraint, bool snapping=false)
 Options for Vector2 tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector3, Vector3, VectorOptions > t, bool snapping)
 Options for Vector3 tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector3, Vector3, VectorOptions > t, AxisConstraint axisConstraint, bool snapping=false)
 Options for Vector3 tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector4, Vector4, VectorOptions > t, bool snapping)
 Options for Vector4 tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector4, Vector4, VectorOptions > t, AxisConstraint axisConstraint, bool snapping=false)
 Options for Vector4 tweens More...
 
static Tweener SetOptions (this TweenerCore< Quaternion, Vector3, QuaternionOptions > t, bool useShortest360Route=true)
 Options for Quaternion tweens More...
 
static Tweener SetOptions (this TweenerCore< Color, Color, ColorOptions > t, bool alphaOnly)
 Options for Color tweens More...
 
static Tweener SetOptions (this TweenerCore< Rect, Rect, RectOptions > t, bool snapping)
 Options for Vector4 tweens More...
 
static Tweener SetOptions (this TweenerCore< string, string, StringOptions > t, bool scramble)
 Options for Vector4 tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector3, Vector3[], Vector3ArrayOptions > t, bool snapping)
 Options for Vector3Array tweens More...
 
static Tweener SetOptions (this TweenerCore< Vector3, Vector3[], Vector3ArrayOptions > t, AxisConstraint axisConstraint, bool snapping=false)
 Options for Vector3Array tweens More...
 

Detailed Description

Methods that extend Tween objects and allow to set their parameters

Member Function Documentation

static Sequence Append ( this Sequence  s,
Tween  t 
)
static

Adds the given tween to the end of the Sequence. Has no effect if the Sequence has already started

Parameters
tThe tween to append
static Sequence AppendCallback ( this Sequence  s,
TweenCallback  callback 
)
static

Adds the given callback to the end of the Sequence. Has no effect if the Sequence has already started

Parameters
callbackThe callback to append
static Sequence AppendInterval ( this Sequence  s,
float  interval 
)
static

Adds the given interval to the end of the Sequence. Has no effect if the Sequence has already started

Parameters
intervalThe interval duration
static T From< T > ( this T  t)
static

Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue then immediately sends the target to the previously set endValue.

Type Constraints
T :Tweener 
static T From< T > ( this T  t,
bool  isRelative 
)
static

Changes a TO tween into a FROM tween: sets the current target's position as the tween's endValue then immediately sends the target to the previously set endValue.

Parameters
isRelativeIf TRUE the FROM value will be calculated as relative to the current one
Type Constraints
T :Tweener 
static Sequence Insert ( this Sequence  s,
float  atPosition,
Tween  t 
)
static

Inserts the given tween at the given time position in the Sequence, automatically adding an interval if needed. Has no effect if the Sequence has already started

Parameters
atPositionThe time position where the tween will be placed
tThe tween to insert
static Sequence InsertCallback ( this Sequence  s,
float  atPosition,
TweenCallback  callback 
)
static

Inserts the given callback at the given time position in the Sequence, automatically adding an interval if needed. Has no effect if the Sequence has already started

Parameters
atPositionThe time position where the callback will be placed
callbackThe callback to insert
static T OnComplete< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onComplete callback for the tween. Called the moment the tween reaches its final forward position, loops included

Type Constraints
T :Tween 
static T OnKill< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onKill callback for the tween. Called the moment the tween is killed

Type Constraints
T :Tween 
static T OnPlay< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onPlay callback for the tween. Called when the tween is set in a playing state, after any eventual delay. Also called each time the tween resumes playing from a paused state

Type Constraints
T :Tween 
static T OnRewind< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onRewind callback for the tween. Called when the tween is rewinded, either by calling

Rewind or by reaching the start position while playing backwards. Rewinding a tween that is already rewinded will not fire this callback

Type Constraints
T :Tween 
static T OnStart< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onStart callback for the tween. Called the first time the tween is set in a playing state, after any eventual delay

Type Constraints
T :Tween 
static T OnStepComplete< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onStepComplete callback for the tween. Called the moment the tween completes one loop cycle, even when going backwards

Type Constraints
T :Tween 
static T OnUpdate< T > ( this T  t,
TweenCallback  action 
)
static

Sets the onUpdate callback for the tween. Called each time the tween updates

Type Constraints
T :Tween 
static Sequence Prepend ( this Sequence  s,
Tween  t 
)
static

Adds the given tween to the beginning of the Sequence, pushing forward the other nested content. Has no effect if the Sequence has already started

Parameters
tThe tween to prepend
static Sequence PrependCallback ( this Sequence  s,
TweenCallback  callback 
)
static

Adds the given callback to the beginning of the Sequence, pushing forward the other nested content. Has no effect if the Sequence has already started

Parameters
callbackThe callback to prepend
static Sequence PrependInterval ( this Sequence  s,
float  interval 
)
static

Adds the given interval to the beginning of the Sequence, pushing forward the other nested content. Has no effect if the Sequence has already started

Parameters
intervalThe interval duration
static T SetAs< T > ( this T  t,
Tween  asTween 
)
static

Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given one. Doesn't copy specific SetOptions settings: those will need to be applied manually each time.

Has no effect if the tween has already started.

NOTE: the tween's target will not be changed

Parameters
asTweenTween from which to copy the parameters
Type Constraints
T :Tween 
static T SetAs< T > ( this T  t,
TweenParms  tweenParms 
)
static

Sets the parameters of the tween (id, ease, loops, delay, timeScale, callbacks, etc) as the parameters of the given TweenParms.

Has no effect if the tween has already started.

Parameters
tweenParmsTweenParms from which to copy the parameters
Type Constraints
T :Tween 
static T SetAutoKill< T > ( this T  t)
static

Sets the autoKill behaviour of the tween. Has no effect if the tween has already started

Type Constraints
T :Tween 
static T SetAutoKill< T > ( this T  t,
bool  autoKillOnCompletion 
)
static

Sets the autoKill behaviour of the tween. Has no effect if the tween has already started

Parameters
autoKillOnCompletionIf TRUE the tween will be automatically killed when complete
Type Constraints
T :Tween 
static T SetDelay< T > ( this T  t,
float  delay 
)
static

Sets a delayed startup for the tween.

Has no effect on Sequences or if the tween has already started

Type Constraints
T :Tween 
static T SetEase< T > ( this T  t,
Ease  ease 
)
static

Sets the ease of the tween.

Has no effect on Sequences

Type Constraints
T :Tween 
static T SetEase< T > ( this T  t,
Ease  ease,
float  overshoot 
)
static

Sets the ease of the tween.

Has no effect on Sequences

Parameters
overshootEventual overshoot to use with Back ease (default is 1.70158)
Type Constraints
T :Tween 
static T SetEase< T > ( this T  t,
Ease  ease,
float  amplitude,
float  period 
)
static

Sets the ease of the tween.

Has no effect on Sequences

Parameters
amplitudeEventual amplitude to use with Elastic easeType (default is 1.70158)
periodEventual period to use with Elastic easeType (default is 0)
Type Constraints
T :Tween 
static T SetEase< T > ( this T  t,
AnimationCurve  animCurve 
)
static

Sets the ease of the tween using an AnimationCurve.

Has no effect on Sequences

Type Constraints
T :Tween 
static T SetEase< T > ( this T  t,
EaseFunction  customEase 
)
static

Sets the ease of the tween using a custom ease function.

Has no effect on Sequences

Type Constraints
T :Tween 
static T SetId< T > ( this T  t,
object  id 
)
static

Sets an ID for the tween, which can then be used as a filter with DOTween's static methods.

Parameters
idThe ID to assign to this tween. Can be an int, a string, an object or anything else.
Type Constraints
T :Tween 
static T SetLoops< T > ( this T  t,
int  loops 
)
static

Sets the looping options for the tween. Has no effect if the tween has already started

Parameters
loopsNumber of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence)
Type Constraints
T :Tween 
static T SetLoops< T > ( this T  t,
int  loops,
LoopType  loopType 
)
static

Sets the looping options for the tween. Has no effect if the tween has already started

Parameters
loopsNumber of cycles to play (-1 for infinite - will be converted to 1 in case the tween is nested in a Sequence)
loopTypeLoop behaviour type (default: LoopType.Restart)
Type Constraints
T :Tween 
static Tweener SetOptions ( this TweenerCore< float, float, FloatOptions >  t,
bool  snapping 
)
static

Options for float tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector2, Vector2, VectorOptions >  t,
bool  snapping 
)
static

Options for Vector2 tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector2, Vector2, VectorOptions >  t,
AxisConstraint  axisConstraint,
bool  snapping = false 
)
static

Options for Vector2 tweens

Parameters
axisConstraintSelecting an axis will tween the vector only on that axis, leaving the others untouched
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector3, Vector3, VectorOptions >  t,
bool  snapping 
)
static

Options for Vector3 tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector3, Vector3, VectorOptions >  t,
AxisConstraint  axisConstraint,
bool  snapping = false 
)
static

Options for Vector3 tweens

Parameters
axisConstraintSelecting an axis will tween the vector only on that axis, leaving the others untouched
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector4, Vector4, VectorOptions >  t,
bool  snapping 
)
static

Options for Vector4 tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector4, Vector4, VectorOptions >  t,
AxisConstraint  axisConstraint,
bool  snapping = false 
)
static

Options for Vector4 tweens

Parameters
axisConstraintSelecting an axis will tween the vector only on that axis, leaving the others untouched
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Quaternion, Vector3, QuaternionOptions >  t,
bool  useShortest360Route = true 
)
static

Options for Quaternion tweens

Parameters
useShortest360RouteIf TRUE (default) the rotation will take the shortest route, and will not rotate more than 360°. If FALSE the rotation will be fully accounted. Is always FALSE if the tween is set as relative
static Tweener SetOptions ( this TweenerCore< Color, Color, ColorOptions >  t,
bool  alphaOnly 
)
static

Options for Color tweens

Parameters
alphaOnlyIf TRUE only the alpha value of the color will be tweened
static Tweener SetOptions ( this TweenerCore< Rect, Rect, RectOptions >  t,
bool  snapping 
)
static

Options for Vector4 tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< string, string, StringOptions >  t,
bool  scramble 
)
static

Options for Vector4 tweens

Parameters
scrambleIf TRUE the string will appear from a random animation of characters
static Tweener SetOptions ( this TweenerCore< Vector3, Vector3[], Vector3ArrayOptions >  t,
bool  snapping 
)
static

Options for Vector3Array tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static Tweener SetOptions ( this TweenerCore< Vector3, Vector3[], Vector3ArrayOptions >  t,
AxisConstraint  axisConstraint,
bool  snapping = false 
)
static

Options for Vector3Array tweens

Parameters
snappingIf TRUE the tween will smoothly snap all values to integers
static T SetRecyclable< T > ( this T  t)
static

Allows the tween to be recycled after being killed.

Type Constraints
T :Tween 
static T SetRecyclable< T > ( this T  t,
bool  recyclable 
)
static

Sets the recycling behaviour for the tween.

Parameters
recyclableIf TRUE the tween will be recycled after being killed, otherwise it will be destroyed.
Type Constraints
T :Tween 
static T SetRelative< T > ( this T  t)
static

Sets the tween as relative (the endValue will be calculated as

startValue + endValue instead than being used directly).

Has no effect on Sequences or if the tween has already started

Type Constraints
T :Tween 
static T SetRelative< T > ( this T  t,
bool  isRelative 
)
static

If isRelative is TRUE sets the tween as relative (the endValue will be calculated as

startValue + endValue instead than being used directly).

Has no effect on Sequences or if the tween has already started

Type Constraints
T :Tween 
static T SetSpeedBased< T > ( this T  t)
static

If isSpeedBased is TRUE sets the tween as speed based (the duration will represent the number of units the tween moves x second).

Has no effect on Sequences, nested tweens, or if the tween has already started

Type Constraints
T :Tween 
static T SetSpeedBased< T > ( this T  t,
bool  isSpeedBased 
)
static

If isSpeedBased is TRUE sets the tween as speed based (the duration will represent the number of units the tween moves x second).

Has no effect on Sequences, nested tweens, or if the tween has already started

Type Constraints
T :Tween 
static T SetTarget< T > ( this T  t,
object  target 
)
static

Sets the target for the tween, which can then be used as a filter with DOTween's static methods.

IMPORTANT: use it with caution. If you just want to set an ID for the tween use SetId instead.

When using shorcuts the shortcut target is already assigned as the tween's target, so using this method will overwrite it and prevent shortcut-operations like myTarget.DOPause from working correctly.

Parameters
targetThe target to assign to this tween. Can be an int, a string, an object or anything else.
Type Constraints
T :Tween 
static T SetUpdate< T > ( this T  t,
bool  isIndependentUpdate 
)
static

Sets the update type to UpdateType.Default and lets you choose if it should be independent from Unity's Time.timeScale

Parameters
isIndependentUpdateIf TRUE the tween will ignore Unity's Time.timeScale
Type Constraints
T :Tween 
static T SetUpdate< T > ( this T  t,
UpdateType  updateType,
bool  isIndependentUpdate = false 
)
static

Sets the type of update (default or independent) for the tween

Parameters
updateTypeThe type of update (defalt: UpdateType.Default)
isIndependentUpdateIf TRUE the tween will ignore Unity's Time.timeScale
Type Constraints
T :Tween