elraccoone / Unity Tweens
Projects that are alternatives of or similar to Unity Tweens
Tweens
An extremely light weight, extendable and customisable tweening engine made for script-based animations for user-interfaces and world-spaces objects optimised for all platforms.
≪ Installation · Documentation · License ≫
Hi! My name is Jeffrey Lanters, thanks for checking out my modules! I've been a Unity developer for years when in 2020 I decided to start sharing my modules by open-sourcing them. So feel free to look around. If you're using this module for production, please consider donating to support the project. When using any of the packages, please make sure to Star this repository and give credit to Jeffrey Lanters somewhere in your app or game. Also keep in mind it it prohibited to sublicense and/or sell copies of the Software in stores such as the Unity Asset Store! Thanks for your time.
≪ Made with ♥ by Jeffrey Lanters ≫
Installation
Using the Unity Package Manager
Install the latest stable release using the Unity Package Manager by adding the following line to your manifest.json
file located within your project's Packages directory, or by adding the Git URL to the Package Manager Window inside of Unity.
"nl.elraccoone.tweens": "git+https://github.com/elraccoone/unity-tweens"
Using OpenUPM
The module is availble on the OpenUPM package registry, you can install the latest stable release using the OpenUPM Package manager's Command Line Tool using the following command.
openupm add nl.elraccoone.tweens
Documentation
This module is benchmarked against LeanTween and ITween and beats both in Unity 2020.1 with running 1000 complex tweens simulataniously. The power and speed you expect get other tweening engines, with strictly typed, clean and ease-to-use chainable methods for all use cases.
The documentation is seperated into two parts; the Tweening Methods, Chainable Options and Methods.
Examples
These are some of the endless possibilities using Tweens.
private void Start () {
myGameObject.TweenLocalRotationX (10, 1).SetFrom (-10).SetDelay (1).SetEaseQuadIn ();
myGameObject.TweenGraphicColor (Color.red, 10).SetPingPong ().SetLoop (10).SetEaseBackInOut ();
myGameObject.TweenValueFloat (0, 2, (value => { })).SetFrom (100).SetEaseSineOut ();
myGameObject.TweenCancelAll ();
}
Tweening Methods
version 1.0.0
TweenPosition Instantiates a Tween animating the Position.
<GameObject, Component>.TweenPosition (Vector3 to, float duration) : Tween;
version 1.0.0
TweenPositionX Instantiates a Tween animating the X axis of the Position.
<GameObject, Component>.TweenPositionX (float to, float duration) : Tween;
version 1.0.0
TweenPositionY Instantiates a Tween animating the Y axis of the Position.
<GameObject, Component>.TweenPositionY (float to, float duration) : Tween;
version 1.0.0
TweenPositionZ Instantiates a Tween animating the Z axis of the Position.
<GameObject, Component>.TweenPositionZ (float to, float duration) : Tween;
version 1.0.0
TweenLocalPosition Instantiates a Tween animating the LocalPosition.
<GameObject, Component>.TweenLocalPosition (Vector3 to, float duration) : Tween;
version 1.0.0
TweenLocalPositionX Instantiates a Tween animating the X axis of the LocalPosition.
<GameObject, Component>.TweenLocalPositionX (float to, float duration) : Tween;
version 1.0.0
TweenLocalPositionY Instantiates a Tween animating the Y axis of the LocalPosition.
<GameObject, Component>.TweenLocalPositionY (float to, float duration) : Tween;
version 1.0.0
TweenLocalPositionZ Instantiates a Tween animating the Z axis of the LocalPosition.
<GameObject, Component>.TweenLocalPositionZ (float to, float duration) : Tween;
version 1.0.2
TweenAnchoredPosition Instantiates a Tween animating the AnchoredPosition.
<GameObject, Component>.TweenAnchoredPosition (Vector2 to, float duration) : Tween;
version 1.0.2
TweenAnchoredPositionX Instantiates a Tween animating the X axis of the AnchoredPosition.
<GameObject, Component>.TweenAnchoredPositionX (float to, float duration) : Tween;
version 1.0.2
TweenAnchoredPositionY Instantiates a Tween animating the Y axis of the AnchoredPosition.
<GameObject, Component>.TweenAnchoredPositionY (float to, float duration) : Tween;
version 1.0.0
TweenRotation Instantiates a Tween animating the Rotation.
<GameObject, Component>.TweenRotation (Vector3 to, float duration) : Tween;
version 1.0.0
TweenRotationX Instantiates a Tween animating the X axis of the Rotation.
<GameObject, Component>.TweenRotationX (float to, float duration) : Tween;
version 1.0.0
TweenRotationY Instantiates a Tween animating the Y axis of the Rotation.
<GameObject, Component>.TweenRotationY (float to, float duration) : Tween;
version 1.0.0
TweenRotationZ Instantiates a Tween animating the Z axis of the Rotation.
<GameObject, Component>.TweenRotationZ (float to, float duration) : Tween;
version 1.0.0
TweenLocalRotation Instantiates a Tween animating the LocalRotation.
<GameObject, Component>.TweenLocalRotation (Vector3 to, float duration) : Tween;
version 1.0.0
TweenLocalRotationX Instantiates a Tween animating the X axis of the LocalRotation.
<GameObject, Component>.TweenLocalRotationX (float to, float duration) : Tween;
version 1.0.0
TweenLocalRotationY Instantiates a Tween animating the Y axis of the LocalRotation.
<GameObject, Component>.TweenLocalRotationY (float to, float duration) : Tween;
version 1.0.0
TweenLocalRotationZ Instantiates a Tween animating the Z axis of the LocalRotation.
<GameObject, Component>.TweenLocalRotationZ (float to, float duration) : Tween;
version 1.0.0
TweenLocalScale Instantiates a Tween animating the LocalScale.
<GameObject, Component>.TweenLocalScale (Vector3 to, float duration) : Tween;
version 1.0.0
TweenLocalScaleX Instantiates a Tween animating the X axis of the LocalScale.
<GameObject, Component>.TweenLocalScaleX (float to, float duration) : Tween;
version 1.0.0
TweenLocalScaleY Instantiates a Tween animating the Y axis of the LocalScale.
<GameObject, Component>.TweenLocalScaleY (float to, float duration) : Tween;
version 1.0.0
TweenLocalScaleZ Instantiates a Tween animating the Z axis of the LocalScale.
<GameObject, Component>.TweenLocalScaleZ (float to, float duration) : Tween;
version 1.0.3
TweenImageFillAmount Instantiates a Tween animating the fillAmount of an image.
<GameObject, Component>.TweenImageFillAmount (float to, float duration) : Tween;
version 1.0.4
TweenGraphicAlpha Instantiates a Tween animating the alpha of a graphic.
<GameObject, Component>.TweenGraphicAlpha (float to, float duration) : Tween;
version 1.0.4
TweenGraphicColor Instantiates a Tween animating the color of a graphic.
<GameObject, Component>.TweenGraphicColor (Color to, float duration) : Tween;
version 1.0.4
TweenSpriteRendererAlpha Instantiates a Tween animating the alpha of a SpriteRenderer.
<GameObject, Component>.TweenSpriteRendererAlpha (float to, float duration) : Tween;
version 1.0.5
TweenSpriteRendererColor Instantiates a Tween animating the color of a SpriteRenderer.
<GameObject, Component>.TweenSpriteRendererColor (Color to, float duration) : Tween;
version 1.0.9
TweenMaterialAlpha Instantiates a Tween animating the alpha of a Material.
<GameObject, Component>.TweenMaterialAlpha (float to, float duration) : Tween;
version 1.0.9
TweenMaterialColor Instantiates a Tween animating the color of a Material.
<GameObject, Component>.TweenMaterialColor (Color to, float duration) : Tween;
version 1.0.8
TweenTextMeshAlpha Instantiates a Tween animating the alpha of a TextMesh.
<GameObject, Component>.TweenTextMeshAlpha (float to, float duration) : Tween;
version 1.0.10
TweenCanvasGroupAlpha Instantiates a Tween animating the alpha of a CanvasGroup.
<GameObject, Component>.TweenCanvasGroupAlpha (float to, float duration) : Tween;
version 1.0.11
TweenAudioSourceVolume Instantiates a Tween easing the volume of an AudioSource.
<GameObject, Component>.TweenAudioSourceVolume (float to, float duration) : Tween;
version 1.0.11
TweenAudioSourcePitch Instantiates a Tween easing the pitch of an AudioSource.
<GameObject, Component>.TweenAudioSourcePitch (float to, float duration) : Tween;
version 1.6.4
TweenCameraFieldOfView Instantiates a Tween easing the field of view of a Camera.
<GameObject, Component>.TweenCameraFieldOfView (float to, float duration) : Tween;
version 1.6.4
TweenCameraOrthographicSize Instantiates a Tween easing the orthographic size of a Camera.
<GameObject, Component>.TweenCameraOrthographicSize (float to, float duration) : Tween;
version 1.0.3
TweenValueFloat Instantiates a Tween animating the a float value.
<GameObject, Component>.TweenValueFloat (float to, float duration, Action<float> onUpdate) : Tween;
version 1.2.0
TweenValueColor Instantiates a Tween animating the a color value.
<GameObject, Component>.TweenValueColor (Color to, float duration, Action<Color> onUpdate) : Tween;
version 1.0.0
TweenDelayedInvoke Instantiates a Tween which invokes a lambra method.
<GameObject, Component>.TweenDelayedInvoke(float duration, Action onComplete) : Tween;
version 1.0.0
TweenCancelAll Cancels all the running tweens.
<GameObject, Component>.TweenCancelAll (bool includeChildren = false, bool includeInactive = false) : Tween;
Chainable Options
version 1.0.0
SetFrom Sets the From value of a tween, when not set the current value will be used.
<Tween>.SetFrom (T valueFrom) : Tween;
version 1.1.0
SetOnComplete Sets the event which will be invoked when the tween completes playing. This will not be invoked when the tween is canceled.
<Tween>.SetOnComplete (Action onComplete) : Tween;
version 1.3.0
SetOnCancel Sets the event which will be invoked when the tween is canceled.
<Tween>.SetOnCancel (Action onCancel) : Tween;
version 1.6.0
SetPingPong Enabled ping pong playback, this will bounce the animation back and forth. The tween has play forward and backwards to count as one cycle. Use either SetLoopCount or SetInifinite to set the number of times the animation should ping pong.
<Tween>.SetPingPong () : Tween;
version 1.2.0
SetLoopCount Sets the number of times the animation should loop.
<Tween>.SetLoopCount (int loopCount) : Tween;
version 1.5.0
SetInfinite Sets this tween to infinite, the loopcount will be ignored.
<Tween>.SetInfinite () : Tween;
version 1.3.0
SetDelay Sets the delay of this tween. The tween will not play anything until the requested delay time is reached. You can change this behaviour by enabeling 'goToFirstFrameImmediately' to set the animation to the first frame immediately.
<Tween>.SetDelay (float delay, bool goToFirstFrameImmediately = false) : Tween;
version 1.1.0
SetTime Sets the time of the tween.
<Tween>.SetTime (float time) : Tween;
version 1.3.0
SetRandomTime Sets the time of the tween to a random value.
<Tween>.SetRandomTime () : Tween;
version 1.4.0
SetPaused Sets whether the playback and delay should be paused.
<Tween>.SetPaused (bool isPaused) : Tween;
version 1.6.1
SetUseUnscaledTime Sets whether the tween should use the unscaled delta time instead of the scaled delta time.
<Tween>.SetUseUnscaledTime (bool useUnscaledTime) : Tween;
version 1.5.0
SetOvershooting Sets the overshooting of Eases that exceed their boundaries such as elastic and back.
<Tween>.SetOvershooting (float overshooting) : Tween;
version 1.5.0
SetEase Sets the ease for this tween.
<Tween>.SetEase (Ease ease) : Tween;
version 1.0.0
SetEaseLinear Sets the ease for this tween to Linear.
<Tween>.SetEaseLinear () : Tween;
version 1.0.0
SetEaseSineIn Sets the ease for this tween to SineIn.
<Tween>.SetEaseSineIn () : Tween;
version 1.0.0
SetEaseSineOut Sets the ease for this tween to SineOut.
<Tween>.SetEaseSineOut () : Tween;
version 1.0.0
SetEaseSineInOut Sets the ease for this tween to SineInOut.
<Tween>.SetEaseSineInOut () : Tween;
version 1.0.0
SetEaseQuadIn Sets the ease for this tween to QuadIn.
<Tween>.SetEaseQuadIn () : Tween;
version 1.0.0
SetEaseQuadOut Sets the ease for this tween to QuadOut.
<Tween>.SetEaseQuadOut () : Tween;
version 1.0.0
SetEaseQuadInOut Sets the ease for this tween to QuadInOut.
<Tween>.SetEaseQuadInOut () : Tween;
version 1.0.0
SetEaseCubicIn Sets the ease for this tween to CubicIn.
<Tween>.SetEaseCubicIn () : Tween;
version 1.0.0
SetEaseCubicOut Sets the ease for this tween to CubicOut.
<Tween>.SetEaseCubicOut () : Tween;
version 1.0.0
SetEaseCubicInOut Sets the ease for this tween to CubicInOut.
<Tween>.SetEaseCubicInOut () : Tween;
version 1.0.0
SetEaseQuartIn Sets the ease for this tween to QuartIn.
<Tween>.SetEaseQuartIn () : Tween;
version 1.0.0
SetEaseQuartOut Sets the ease for this tween to QuartOut.
<Tween>.SetEaseQuartOut () : Tween;
version 1.0.0
SetEaseQuartInOut Sets the ease for this tween to QuartInOut.
<Tween>.SetEaseQuartInOut () : Tween;
version 1.0.0
SetEaseQuintIn Sets the ease for this tween to QuintIn.
<Tween>.SetEaseQuintIn () : Tween;
version 1.0.0
SetEaseQuintOut Sets the ease for this tween to QuintOut.
<Tween>.SetEaseQuintOut () : Tween;
version 1.0.0
SetEaseQuintInOut Sets the ease for this tween to QuintInOut.
<Tween>.SetEaseQuintInOut () : Tween;
version 1.0.0
SetEaseExpoIn Sets the ease for this tween to ExpoIn.
<Tween>.SetEaseExpoIn () : Tween;
version 1.0.0
SetEaseExpoOut Sets the ease for this tween to ExpoOut.
<Tween>.SetEaseExpoOut () : Tween;
version 1.0.0
SetEaseExpoInOut Sets the ease for this tween to ExpoInOut.
<Tween>.SetEaseExpoInOut () : Tween;
version 1.0.0
SetEaseCircIn Sets the ease for this tween to CircIn.
<Tween>.SetEaseCircIn () : Tween;
version 1.0.0
SetEaseCircOut Sets the ease for this tween to CircOut.
<Tween>.SetEaseCircOut () : Tween;
version 1.0.0
SetEaseCircInOut Sets the ease for this tween to CircInOut.
<Tween>.SetEaseCircInOut () : Tween;
version 1.0.0
SetEaseBackIn Sets the ease for this tween to BackIn.
<Tween>.SetEaseBackIn () : Tween;
version 1.0.0
SetEaseBackOut Sets the ease for this tween to BackOut.
<Tween>.SetEaseBackOut () : Tween;
version 1.0.0
SetEaseBackInOut Sets the ease for this tween to BackInOut.
<Tween>.SetEaseBackInOut () : Tween;
version 1.0.0
SetEaseElasticIn Sets the ease for this tween to ElasticIn.
<Tween>.SetEaseElasticIn () : Tween;
version 1.0.0
SetEaseElasticOut Sets the ease for this tween to ElasticOut.
<Tween>.SetEaseElasticOut () : Tween;
version 1.0.0
SetEaseElasticInOut Sets the ease for this tween to ElasticInOut.
<Tween>.SetEaseElasticInOut () : Tween;
version 1.0.0
SetEaseBounceIn Sets the ease for this tween to BounceIn.
<Tween>.SetEaseBounceIn () : Tween;
version 1.0.0
SetEaseBounceOut Sets the ease for this tween to BounceOut.
<Tween>.SetEaseBounceOut () : Tween;
version 1.0.0
SetEaseBounceInOut Sets the ease for this tween to BounceInOut.
<Tween>.SetEaseBounceInOut () : Tween;
Methods
version 1.0.0
Cancel Cancel the tween.
<Tween>.Cancel () : void;
version 1.6.2
GetTotalDuration Gets the total duration of the tween including the loop count and ping pong settings, and the delay optionally.
<Tween>.GetTotalDuration (bool includeDelay = false) : float;