LeanTweenDescr Class
Internal Representation of a Tween
Constructor
LeanTweenDescr
()
Item Index
Methods
Methods
cancel
()
LeanTweenDescr
Cancel a tween
Returns:
LeanTweenDescr an object that distinguishes the tween
pause
()
LeanTweenDescr
Pause a tween
Returns:
LeanTweenDescr an object that distinguishes the tween
resume
()
LeanTweenDescr
Resume a paused tween
Returns:
LeanTweenDescr an object that distinguishes the tween
setDelay
-
float
Delay the start of a tween
Parameters:
-
float
Floattime The time to complete the tween in
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setDelay( 1.5f );
setEase
-
easeType:LeanTweenType
Set the type of easing used for the tween.
Parameters:
-
easeType:LeanTweenType
LeanTweenTypethe easing type to use
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setEase( LeanTweenType.easeInBounce );
setEase (AnimationCurve)
-
easeDefinition:AnimationCurve
Set the type of easing used for the tween with a custom curve.
Parameters:
-
easeDefinition:AnimationCurve
AnimationCurvean AnimationCure that describes the type of easing you want, this is great for when you want a unique type of movement
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setEase( LeanTweenType.easeInBounce );
setLoopClamp
()
LeanTweenDescr
When the animation gets to the end it starts back at where it began
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat(2).setLoopClamp();
setLoopOnce
()
LeanTweenDescr
No looping involved, just run once (the default)
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setLoopOnce();
setLoopPingPong
()
LeanTweenDescr
When the animation gets to the end it then tweens back to where it started (and on, and on)
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat(2).setLoopClamp();
setOnComplete
-
onComplete:Action
Have a method called when the tween finishes
Parameters:
-
onComplete:Action
Actionthe method that should be called when the tween is finished ex: tweenFinished(){ }
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnComplete( tweenFinished );
setOnComplete (object)
-
onComplete:Action<object>
Have a method called when the tween finishes
Parameters:
-
onComplete:Action<object>
Actionthe method that should be called when the tween is finished ex: tweenFinished( object myObj ){ }
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnComplete( tweenFinished );
setOnCompleteParam
-
onComplete:object
Pass an object to along with the onComplete Function
Parameters:
-
onComplete:object
Objectan object that
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnComplete( tweenFinished );
setOnUpdate
-
onUpdate:Action<float>
Have a method called on each frame that the tween is being animated (passes a float value)
Parameters:
-
onUpdate:Action<float>
Actiona method that will be called on every frame with the float value of the tweened object
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnUpdate( tweenMoved );
void tweenMoved( float val ){ }
setOnUpdate (object)
-
onUpdate:Action<float,object>
Have a method called on each frame that the tween is being animated (passes a float value and a object)
Parameters:
-
onUpdate:Action<float,object>
Actiona method that will be called on every frame with the float value of the tweened object, and an object of the person's choosing
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnUpdate( tweenMoved ).setOnUpdateParam( myObject );
void tweenMoved( float val, object obj ){ }
setOnUpdate (Vector3)
-
onUpdate:Action<Vector3>
Have a method called on each frame that the tween is being animated (passes a float value)
Parameters:
-
onUpdate:Action<Vector3>
Actiona method that will be called on every frame with the float value of the tweened object
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnUpdate( tweenMoved );
void tweenMoved( Vector3 val ){ }
setOnUpdateParam
-
onUpdateParam:object
Have an object passed along with the onUpdate method
Parameters:
-
onUpdateParam:object
Objectan object that will be passed along with the onUpdate method
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setOnUpdate( tweenMoved ).setOnUpdateParam( myObject );
void tweenMoved( float val, object obj ){ }
setOrientToPath
-
doesOrient:bool
While tweening along a curve, set this property to true, to be perpendicalur to the path it is moving upon
Parameters:
-
doesOrient:bool
Boolwhether the gameobject will orient to the path it is animating along
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.move( ltLogo, path, 1.0f ).setEase(LeanTweenType.easeOutQuad).setOrientToPath(true);
setPoint
-
point:Vector3
Set the point at which the GameObject will be rotated around
Parameters:
-
point:Vector3
Vector3point at which you want the object to rotate around (local space)
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.rotateAround( cube, Vector3.up, 360.0f, 1.0f ) .setPoint( new Vector3(1f,0f,0f) ) .setEase( LeanTweenType.easeInOutBounce );
setRepeat
-
repeatNum:int
Set the tween to repeat a number of times.
Parameters:
-
repeatNum:int
Intthe number of times to repeat the tween. -1 to repeat infinite times
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 10 ).setLoopPingPong();
setUseEstimatedTime
-
useEstimatedTime:bool
Use estimated time when tweening an object. Great for pause screens, when you want all other action to be stopped (or slowed down)
Parameters:
-
useEstimatedTime:bool
Boolwhether to use estimated time or not
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 2 ).setUseEstimatedTime( true );
setUseFrames
-
useFrames:bool
Use frames when tweening an object, when you don't want the animation to be time-frame independent...
Parameters:
-
useFrames:bool
Boolwhether to use estimated time or not
Returns:
LeanTweenDescr an object that distinguishes the tween
Example:
LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 2 ).setUseFrames( true );