- Developed by Dented Pixel
API Docs for: LeanTween 2.14

Support LeanTween!

Show:

LTDescr Class

Defined in: LeanTween.cs:148

Internal Representation of a Tween

This class represents all of the optional parameters you can pass to a method (it also represents the internal representation of the tween).

Optional Parameters are passed at the end of every method:

  Example:
  LeanTween.moveX( gameObject, 1f, 1f).setEase( LeanTweenType.easeInQuad ).setDelay(1f);

You can pass the optional parameters in any order, and chain on as many as you wish.
You can also pass parameters at a later time by saving a reference to what is returned.

  Example:
  LTDescr d = LeanTween.moveX(gameObject, 1f, 1f);
    ...later set some parameters
  d.setOnComplete( onCompleteFunc ).setEase( LeanTweenType.easeInOutBack );

Retrieve a unique id for the tween by using the "id" property. You can pass this to LeanTween.pause, LeanTween.resume, LeanTween.cancel methods

  Example:
  int id = LeanTween.moveX(gameObject, 1f, 3f).id;
  LeanTween.pause( id );

Constructor

LTDescr

()

Defined in LeanTween.cs:148

Methods

cancel

() LTDescr

Defined in LeanTween.cs:226

Cancel a tween

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

pause

() LTDescr

Defined in LeanTween.cs:280

Pause a tween

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

resume

() LTDescr

Defined in LeanTween.cs:295

Resume a paused tween

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

setDelay

(
  • float
)
LTDescr

Defined in LeanTween.cs:311

Delay the start of a tween

Parameters:

  • float Float

    time The time to complete the tween in

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setDelay( 1.5f );

setEase

(
  • easeType:LeanTweenType
)
LTDescr

Defined in LeanTween.cs:330

Parameters:

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setEase( LeanTweenType.easeInBounce );

setEase (AnimationCurve)

(
  • easeDefinition:AnimationCurve
)
LTDescr

Defined in LeanTween.cs:347

Set the type of easing used for the tween with a custom curve.

Parameters:

  • easeDefinition:AnimationCurve AnimationCurve

    an AnimationCure that describes the type of easing you want, this is great for when you want a unique type of movement

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setEase( LeanTweenType.easeInBounce );

setLoopClamp

() LTDescr

Defined in LeanTween.cs:444

When the animation gets to the end it starts back at where it began

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat(2).setLoopClamp();

setLoopOnce

() LTDescr

Defined in LeanTween.cs:435

No looping involved, just run once (the default)

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setLoopOnce();

setLoopPingPong

() LTDescr

Defined in LeanTween.cs:458

When the animation gets to the end it then tweens back to where it started (and on, and on)

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat(2).setLoopPingPong();

setOnComplete

(
  • onComplete:Action
)
LTDescr

Defined in LeanTween.cs:472

Have a method called when the tween finishes

Parameters:

  • onComplete:Action Action

    the method that should be called when the tween is finished ex: tweenFinished(){ }

Returns:

LTDescr:

LTDescr an object that distinguishes the tween

Example:

LeanTween.moveX(gameObject, 5f, 2.0f ).setOnComplete( tweenFinished );

setOnComplete (object)

(
  • onComplete:Action<object>
)
LTDescr

Defined in LeanTween.cs:485

Have a method called when the tween finishes

Parameters:

  • onComplete:Action<object> Action

    the method that should be called when the tween is finished ex: tweenFinished( object myObj ){ }

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.moveX(gameObject, 5f, 2.0f ).setOnComplete( tweenFinished );

    setOnCompleteOnRepeat

    (
    • isOn:bool
    )
    LTDescr

    Defined in LeanTween.cs:662

    Set the onComplete method to be called at the end of every loop cycle (also applies to the delayedCall method)

    Parameters:

    • isOn:bool Bool

      does call onComplete on every loop cycle

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.delayedCall(gameObject,0.3f, delayedMethod).setRepeat(4).setOnCompleteOnRepeat(true);

    setOnCompleteParam

    (
    • onComplete:object
    )
    LTDescr

    Defined in LeanTween.cs:504

    Pass an object to along with the onComplete Function

    Parameters:

    • onComplete:object Object

      an object that

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.moveX(gameObject, 5f, 2.0f ).setOnComplete( tweenFinished );

    setOnUpdate

    (
    • onUpdate:Action<float>
    )
    LTDescr

    Defined in LeanTween.cs:518

    Have a method called on each frame that the tween is being animated (passes a float value)

    Parameters:

    • onUpdate:Action<float> Action

      a method that will be called on every frame with the float value of the tweened object

    Returns:

    LTDescr:

    LTDescr 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>
    )
    LTDescr

    Defined in LeanTween.cs:547

    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> Action

      a 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:

    LTDescr:

    LTDescr 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>
    )
    LTDescr

    Defined in LeanTween.cs:571

    Have a method called on each frame that the tween is being animated (passes a float value)

    Parameters:

    • onUpdate:Action<Vector3> Action

      a method that will be called on every frame with the float value of the tweened object

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.moveX(gameObject, 5f, 2.0f ).setOnUpdate( tweenMoved );

    void tweenMoved( Vector3 val ){ }

    setOnUpdateParam

    (
    • onUpdateParam:object
    )
    LTDescr

    Defined in LeanTween.cs:590

    Have an object passed along with the onUpdate method

    Parameters:

    • onUpdateParam:object Object

      an object that will be passed along with the onUpdate method

    Returns:

    LTDescr:

    LTDescr 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
    )
    LTDescr

    Defined in LeanTween.cs:605

    While tweening along a curve, set this property to true, to be perpendicalur to the path it is moving upon

    Parameters:

    • doesOrient:bool Bool

      whether the gameobject will orient to the path it is animating along

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.move( ltLogo, path, 1.0f ).setEase(LeanTweenType.easeOutQuad).setOrientToPath(true).setAxis(Vector3.forward);

    setPoint

    (
    • point:Vector3
    )
    LTDescr

    Defined in LeanTween.cs:639

    Set the point at which the GameObject will be rotated around

    Parameters:

    • point:Vector3 Vector3

      point at which you want the object to rotate around (local space)

    Returns:

    LTDescr:

    LTDescr 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
    )
    LTDescr

    Defined in LeanTween.cs:383

    Set the tween to repeat a number of times.

    Parameters:

    • repeatNum:int Int

      the number of times to repeat the tween. -1 to repeat infinite times

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 10 ).setLoopPingPong();

    setUseEstimatedTime

    (
    • useEstimatedTime:bool
    )
    LTDescr

    Defined in LeanTween.cs:404

    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 Bool

      whether to use estimated time or not

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 2 ).setUseEstimatedTime( true );

    setUseFrames

    (
    • useFrames:bool
    )
    LTDescr

    Defined in LeanTween.cs:417

    Use frames when tweening an object, when you don't want the animation to be time-frame independent...

    Parameters:

    • useFrames:bool Bool

      whether to use estimated time or not

    Returns:

    LTDescr:

    LTDescr an object that distinguishes the tween

    Example:

    LeanTween.moveX(gameObject, 5f, 2.0f ).setRepeat( 2 ).setUseFrames( true );