Support LeanTween! |
LeanTween.cs:1344
LeanTween is an efficient tweening engine for Unity3d
Index of All Methods |Optional Paramaters that can be passed
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 );
LeanTween.addListener
caller:GameObject
eventId:int
callback:System.Action<LTEvent>
Defined inLeanTween.cs:3861
Add a listener method to be called when the appropriate LeanTween.dispatchEvent is called
caller:GameObject
GameObjectthe gameObject the listener is attached to
eventId:int
Inta unique int that describes the event (best to use an enum)
callback:System.Action<LTEvent>
System.Actionthe method to call when the event has been dispatched
LeanTween.addListener(gameObject, (int)MyEvents.JUMP, jumpUp);
void jumpUp( LTEvent e ){ Debug.Log("jump!"); }
LeanTween.alpha
ltRect:LTRect
to:float
time:float
Defined inLeanTween.cs:2458
Fade a GUI Object
ltRect:LTRect
LTRectLTRect that you wish to fade
to:float
Floatthe final alpha value (0-1)
time:float
FloatThe time with which to fade the object
LTDescr an object that distinguishes the tween
LeanTween.alpha(ltRect, 1f, 1f) .setEase(LeanTweenType.easeInCirc);
LeanTween.alpha
gameObject:GameObject
to:float
time:float
Defined inLeanTween.cs:2443
Fade a gameobject's material to a certain alpha value. The material's shader needs to support alpha.Owl labs has some excellent efficient shaders.
gameObject:GameObject
GameObjectGameobject that you wish to fade
to:float
Floatthe final alpha value (0-1)
time:float
FloatThe time with which to fade the object
LTDescr an object that distinguishes the tween
LeanTween.alpha(gameObject, 1f, 1f) .setDelay(1f);
LeanTween.alphaVertex
gameObject:GameObject
to:float
time:float
Defined inLeanTween.cs:2474
This works by tweening the vertex colors directly.
Vertex-based coloring is useful because you avoid making a copy of yourobject's material for each instance that needs a different color.
A shader that supports vertex colors is required for it to work(for example the shaders in Mobile/Particles/)
gameObject:GameObject
GameObjectGameobject that you wish to alpha
to:float
FloatThe alpha value you wish to tween to
time:float
FloatThe time with which to delay before calling the function
LTDescr an object that distinguishes the tween
LeanTween.cancel
gameObject:GameObject
id:int
Defined inLeanTween.cs:2202
Cancel a specific tween with the provided id
gameObject:GameObject
GameObjectgameObject whose tweens you want to cancel
id:int
Floatunique id that represents that tween
LeanTween.cancel
ltRect:LTRect
id:int
Defined inLeanTween.cs:2220
Cancel a specific tween with the provided id
ltRect:LTRect
LTRectLTRect object whose tweens you want to cancel
id:int
Floatunique id that represents that tween
LeanTween.cancel
gameObject:GameObject
Defined inLeanTween.cs:2185
Cancel all tweens that are currently targeting the gameObject
gameObject:GameObject
GameObjectgameObject whose tweens you wish to cancel
LeanTween.move( gameObject, new Vector3(0f,1f,2f), 1f);
LeanTween.cancel( gameObject );
LeanTween.color
gameObject:GameObject
to:Color
time:float
Defined inLeanTween.cs:2493
Change a gameobject's material to a certain color value. The material's shader needs to support color tinting.Owl labs has some excellent efficient shaders.
gameObject:GameObject
GameObjectGameobject that you wish to change the color
to:Color
Colorthe final color value ex: Color.Red, new Color(1.0f,1.0f,0.0f,0.8f)
time:float
FloatThe time with which to fade the object
LTDescr an object that distinguishes the tween
LeanTween.color(gameObject, Color.yellow, 1f) .setDelay(1f);
LeanTween.dispatchEvent
eventId:int
data:object
Defined inLeanTween.cs:3936
Tell the added listeners that you are dispatching the event
eventId:int
Inta unique int that describes the event (best to use an enum)
data:object
ObjectPass data to the listener, access it from the listener with *.data on the LTEvent object
LeanTween.dispatchEvent( (int)MyEvents.JUMP, transform );
void jumpUp( LTEvent e ){
Transform tran = (Transform)e.data;
}
LeanTween.dispatchEvent
eventId:int
Defined inLeanTween.cs:3925
Tell the added listeners that you are dispatching the event
eventId:int
Inta unique int that describes the event (best to use an enum)
LeanTween.dispatchEvent( (int)MyEvents.JUMP );
LeanTween.init
maxSimultaneousTweens:int
Defined inLeanTween.cs:1386
This line is optional. Here you can specify the maximum number of tweens you will use (the default is 400). This must be called before any use of LeanTween is made for it to be effective.
maxSimultaneousTweens:int
IntegerThe maximum number of tweens you will use, make sure you don't go over this limit, otherwise the code will throw an error
LeanTween.init( 800 );
LeanTween.isTweening
ltRect:LTRect
Defined inLeanTween.cs:2359
Test whether or not a tween is active on a LTRect
ltRect:LTRect
LTRectLTRect that you want to test if it is tweening
LeanTween.isTweening
gameObject:GameObject
Defined inLeanTween.cs:2324
Test whether or not a tween is active on a GameObject
gameObject:GameObject
GameObjectGameObject that you want to test if it is tweening
LeanTween.isTweening
id:int
Defined inLeanTween.cs:2339
Test whether or not a tween is active or not
id:int
GameObjectid of the tween that you want to test if it is tweening Example:
int id = LeanTween.moveX(gameObject, 1f, 3f).id;
if(LeanTween.isTweening( id ))
Debug.Log("I am tweening!");
LeanTween.move
GameObject
vec:Vector3
time:float
Defined inLeanTween.cs:2532
Move a GameObject to a certain location
GameObject
GameObjectgameObject Gameobject that you wish to move
vec:Vector3
Vector3to The final positin with which to move to
time:float
Floattime The time to complete the tween in
LTDescr an object that distinguishes the tween
LeanTween.move(gameObject, new Vector3(0f,-3f,5f), 2.0f) .setEase( LeanTweenType.easeOutQuad );
LeanTween.move
gameObject:GameObject
[]
time:float
Defined inLeanTween.cs:2550
Move a GameObject along a set of bezier curves
gameObject:GameObject
GameObjectGameobject that you wish to move
[]
Vector3optionalA set of points that define the curve(s) ex: Point1,Handle2,Handle1,Point2,...
time:float
FloatThe time to complete the tween in
LTDescr an object that distinguishes the tween
#"../classes/LTDescr.html">LTDescr Defined in Move a GUI Element to a certain location ltRect LTRect object that you wish to move to The final position with which to move to (pixel coordinates) time The time to complete the tween in LTDescr an object that distinguishes the tweenLeanTween.cs:2616
Parameters:
ltRect:LTRect
LTRectvec:Vector2
Vector2time:float
FloatReturns:
LeanTween.moveLocal
gameObject:GameObject
[]
time:float
Defined inLeanTween.cs:2686
Move a GameObject along a set of bezier curves, in local space
gameObject:GameObject
GameObjectGameobject that you wish to move
[]
Vector3optionalA set of points that define the curve(s) ex: Point1,Handle1,Handle2,Point2,...
time:float
FloatThe time to complete the tween in
LTDescr an object that distinguishes the tween
#"../classes/LTDescr.html">LTDescr Defined in Move a GameObject to a certain location relative to the parent transform. gameObject Gameobject that you wish to rotate to The final positin with which to move to time The time to complete the tween in optional Hashtable where you can passoptional items. LTDescr an object that distinguishes the tweenLeanTween.cs:2672
Parameters:
GameObject
GameObjectVector3
Vector3float
FloatHashtable
HashtableReturns:
LeanTween.moveSpline
gameObject:GameObject
[]
time:float
Defined inLeanTween.cs:2574
Move a GameObject through a set of points
gameObject:GameObject
GameObjectGameobject that you wish to move
[]
Vector3optionalA set of points that define the curve(s) ex: ControlStart,Pt1,Pt2,Pt3,.. ..ControlEnd
time:float
FloatThe time to complete the tween in
LTDescr an object that distinguishes the tween
#"../classes/LTDescr.html">LTDescr Defined in Move a GameObject through a set of points, in local space Gameobject that you wish to move A set of points that define the curve(s) ex: ControlStart,Pt1,Pt2,Pt3,.. ..ControlEnd The time to complete the tween in LTDescr an object that distinguishes the tween #"../classes/LTDescr.html">LTDescr Defined in Move a GameObject along the x-axis gameObject Gameobject that you wish to move to The final position with which to move to time The time to complete the move in LTDescr an object that distinguishes the tween Defined in Move a GameObject along the y-axis gameObject Gameobject that you wish to move to The final position with which to move to time The time to complete the move in LTDescr an object that distinguishes the tween Defined in Move a GameObject along the z-axis gameObject Gameobject that you wish to move to The final position with which to move to time The time to complete the move in LTDescr an object that distinguishes the tween Defined in Pause all tweens for a GameObject GameObject whose tweens you want to pause Defined in Remove an event listener you have added the gameObject the listener is attached to a unique int that describes the event (best to use an enum) the method that was specified to call when the event has been dispatched LeanTween.removeListener(gameObject, (int)MyEvents.JUMP, jumpUp); Defined in Resume a specific tween Id of the tween you want to resume ex: int id = LeanTween.MoveX(gameObject, 5, 1.0).id; Defined in Resume all the tweens on a GameObject GameObject whose tweens you want to resume Defined in Rotate a GUI element (using an LTRect object), to a value that is in degrees LTRect that you wish to rotate The final rotation with which to rotate to The time to complete the tween in Object Array where you can passoptional items. LTDescr an object that distinguishes the tween if(GUI.Button(buttonRect.rect, "Rotate")) Defined in Rotate a GameObject, to values are in passed in degrees gameObject Gameobject that you wish to rotate to The final rotation with which to rotate to time The time to complete the tween in LTDescr an object that distinguishes the tween LeanTween.rotate(cube, new Vector3(180f,30f,0f), 1.5f); Defined in Rotate a GameObject around a certain Axis (the best method to use when you want to rotate beyond 180 degrees) Gameobject that you wish to rotate axis in which to rotate around ex: Vector3.up the degrees in which to rotate time The time to complete the rotation in LTDescr an object that distinguishes the tween Example: Defined in Rotate a GameObject around a certain Axis in Local Space (the best method to use when you want to rotate beyond 180 degrees) Gameobject that you wish to rotate axis in which to rotate around ex: Vector3.up the degrees in which to rotate time The time to complete the rotation in LTDescr an object that distinguishes the tween Example: Defined in Rotate a GameObject in the objects local space (on the transforms localEulerAngles object) Gameobject that you wish to rotate The final rotation with which to rotate to The time to complete the rotation in LTDescr an object that distinguishes the tween Defined in Rotate a GameObject only on the X axis Gameobject that you wish to rotate The final x-axis rotation with which to rotate The time to complete the rotation in LTDescr an object that distinguishes the tween Defined in Rotate a GameObject only on the Y axis Gameobject that you wish to rotate The final y-axis rotation with which to rotate The time to complete the rotation in LTDescr an object that distinguishes the tween Defined in Rotate a GameObject only on the Z axis Gameobject that you wish to rotate The final z-axis rotation with which to rotate The time to complete the rotation in LTDescr an object that distinguishes the tween Defined in Scale a GameObject to a certain size gameObject Gameobject that you wish to scale to The size with which to tween to time The time to complete the tween in LTDescr an object that distinguishes the tween Defined in Scale a GUI Element to a certain width and height ltRect LTRect object that you wish to move to The final width and height to scale to (pixel based) time The time to complete the tween in LTDescr an object that distinguishes the tween Example #"../classes/LTDescr.html">LTDescr Defined in Scale a GameObject to a certain size along the x-axis only Gameobject that you wish to scale the size with which to scale to the time to complete the tween in LTDescr an object that distinguishes the tween Defined in Scale a GameObject to a certain size along the y-axis only Gameobject that you wish to scale the size with which to scale to the time to complete the tween in LTDescr an object that distinguishes the tween Defined in Scale a GameObject to a certain size along the z-axis only Gameobject that you wish to scale the size with which to scale to the time to complete the tween in LTDescr an object that distinguishes the tween Defined in Tween from one color to another gameObject GameObject with which to tie the tweening with. This is only used when you need to cancel this tween, it does not actually perform any operations on this gameObject The function that is called on every Update frame, this function needs to accept a color value ex: function updateValue( Color val ){ } from The original value to start the tween from to The value to end the tween on time The time to complete the tween in LTDescr an object that distinguishes the tween Example #"../classes/LTDescr.html">LTDescr Defined in Tween any particular value, it does not need to be tied to any particular type or GameObject gameObject GameObject with which to tie the tweening with. This is only used when you need to cancel this tween, it does not actually perform any operations on this gameObject The function that is called on every Update frame, this function needs to accept a float value ex: function updateValue( float val ){ } from The original value to start the tween from to The value to end the tween on time The time to complete the tween in LTDescr an object that distinguishes the tween Example #"../classes/LTDescr.html">LTDescr Defined in Tween any particular value (float) Gameobject that you wish to attach the tween to The function that is called on every Update frame, this function needs to accept a float value ex: function updateValue( Vector3 val, object obj ){ } The original value to start the tween from The final Vector3 with which to tween to The time to complete the tween in LTDescr an object that distinguishes the tween Defined in Tween any particular value (Vector3), this could be used to tween an arbitrary value like a material color Gameobject that you wish to attach the tween to The function that is called on every Update frame, this function needs to accept a float value ex: function updateValue( Vector3 val ){ } The original value to start the tween from The final Vector3 with which to tween to The time to complete the tween in LTDescr an object that distinguishes the tweenLeanTween.cs:2595
Parameters:
gameObject:GameObject
GameObject[]
Vector3optionaltime:float
FloatReturns:
Example:
LeanTween.cs:2633
Parameters:
gameObject:GameObject
GameObjectto:float
Floattime:float
FloatReturns:
LeanTween.moveY
)GameObject
float
float
LeanTween.cs:2646
Parameters:
GameObject
GameObjectfloat
Floatfloat
FloatReturns:
LeanTween.moveZ
)GameObject
float
float
LeanTween.cs:2659
Parameters:
GameObject
GameObjectfloat
Floatfloat
FloatReturns:
LeanTween.pause
)gameObject:GameObject
LeanTween.cs:2276
Parameters:
gameObject:GameObject
GameObjectLeanTween.removeListener
)caller:GameObject
eventId:int
callback:System.Action<LTEvent>
LeanTween.cs:3902
Parameters:
caller:GameObject
GameObjecteventId:int
Intcallback:System.Action<LTEvent>
System.ActionExample:
void jumpUp( LTEvent e ){ }LeanTween.resume
)id:int
LeanTween.cs:2296
Parameters:
id:int
IntLeanTween.resume
)gameObject:GameObject
LeanTween.cs:2310
Parameters:
gameObject:GameObject
GameObjectLeanTween.rotate
)ltRect:LTRect
to:float
time:float
optional:Array
LeanTween.cs:2737
Parameters:
ltRect:LTRect
LTRectto:float
Floattime:float
Floatoptional:Array
ArrayReturns:
Example:
LeanTween.rotate( buttonRect4, 150.0f, 1.0f).setEase(LeanTweenType.easeOutElastic);
GUI.matrix = Matrix4x4.identity;LeanTween.rotate
)GameObject
Vector3
float
LeanTween.cs:2722
Parameters:
GameObject
GameObjectVector3
Vector3float
FloatReturns:
Example:
LeanTween.rotateAround
)gameObject:GameObject
vec:Vector3
degrees:float
time:float
LeanTween.cs:2807
Parameters:
gameObject:GameObject
GameObjectvec:Vector3
Vector3degrees:float
Floattime:float
FloatReturns:
Example:
LeanTween.rotateAround ( gameObject, Vector3.left, 90f, 1f );LeanTween.rotateAroundLocal
)gameObject:GameObject
vec:Vector3
degrees:float
time:float
LeanTween.cs:2824
Parameters:
gameObject:GameObject
GameObjectvec:Vector3
Vector3degrees:float
Floattime:float
FloatReturns:
Example:
LeanTween.rotateAround ( gameObject, Vector3.left, 90f, 1f );LeanTween.rotateLocal
)gameObject:GameObject
to:Vector3
time:float
LeanTween.cs:2755
Parameters:
gameObject:GameObject
GameObjectto:Vector3
Vector3time:float
FloatReturns:
LeanTween.rotateX
)GameObject
to:float
time:float
LeanTween.cs:2768
Parameters:
GameObject
GameObjectto:float
Floattime:float
FloatReturns:
LeanTween.rotateY
)GameObject
to:float
time:float
LeanTween.cs:2781
Parameters:
GameObject
GameObjectto:float
Floattime:float
FloatReturns:
LeanTween.rotateZ
)GameObject
to:float
time:float
LeanTween.cs:2794
Parameters:
GameObject
GameObjectto:float
Floattime:float
FloatReturns:
LeanTween.scale
)gameObject:GameObject
vec:Vector3
time:float
LeanTween.cs:2841
Parameters:
gameObject:GameObject
GameObjectvec:Vector3
Vector3time:float
FloatReturns:
LeanTween.scale (GUI)
)LTRect
Vector2
float
LeanTween.cs:2854
Parameters:
LTRect
LTRectVector2
Vector2float
FloatReturns:
Example:
LeanTween.cs:2881
Parameters:
gameObject:GameObject
GameObjectscaleTo:float
Floattime:float
FloatReturns:
LeanTween.scaleY
)gameObject:GameObject
scaleTo:float
time:float
LeanTween.cs:2894
Parameters:
gameObject:GameObject
GameObjectscaleTo:float
Floattime:float
FloatReturns:
LeanTween.scaleZ
)gameObject:GameObject
scaleTo:float
time:float
LeanTween.cs:2907
Parameters:
gameObject:GameObject
GameObjectscaleTo:float
Floattime:float
FloatReturns:
LeanTween.value (Color)
)GameObject
callOnUpdate:Action<Color>
Color
Color
Color
LeanTween.cs:2948
Parameters:
GameObject
GameObjectcallOnUpdate:Action<Color>
ActionColor
ColorColor
ColorColor
ColorReturns:
Example:
LeanTween.cs:2920
Parameters:
GameObject
GameObjectcallOnUpdate:Action<float>
Actionfloat
Floatfloat
Floatfloat
FloatReturns:
Example:
LeanTween.cs:2992
Parameters:
gameObject:GameObject
GameObjectcallOnUpdate:Action<float,object>
Actionfrom:Vector3
Floatto:Vector3
Vector3time:float
FloatReturns:
LeanTween.value (Vector3)
)gameObject:GameObject
callOnUpdate:Action<Vector3>
from:Vector3
to:Vector3
time:float
LeanTween.cs:2977
Parameters:
gameObject:GameObject
GameObjectcallOnUpdate:Action<Vector3>
Actionfrom:Vector3
Floatto:Vector3
Vector3time:float
FloatReturns: