Lightweight tweening library for Unity UI Toolkit. Provides a fluent, zero-configuration API for animating properties such as position, size, opacity, rotation, scale, colors, and more. Supports sequences, loops, delays, custom easing, and manual tick control for more flexibility in how you want to use it and testability.
Open Window > Package Manager, click +, and choose Add package from git URL.
To install the latest version:
https://github.com/Warlander/tweenkit.git
To install a specific release, append the tag:
https://github.com/Warlander/tweenkit.git#1.0.2
If you have Registry Browser in the project, make sure you have tracked registry added:
Scope Prefix: com.warlogic
Registry URL: https://upm.maciejcyranowicz.com
Then open Window > Warlander > Registry Browser and add com.warlogic.tweenkit to the project.
Add the Warlogic registry to your Packages/manifest.json:
{
"scopedRegistries": [
{
"name": "Warlogic",
"url": "https://upm.maciejcyranowicz.com",
"scopes": ["com.warlogic"]
}
],
"dependencies": {
"com.warlogic.tweenkit": "1.0.2"
}
}Then open Window > Package Manager and look for com.warlogic.tweenkit.
Call TK.Initialize() once at startup. This creates a hidden GameObject with a ticker that drives the tween engine on Update.
TK.Initialize();Call TK.Shutdown() when cleaning up to dispose the engine and destroy the ticker. This is only necessary if you no longer wish to use Tweenkit within the same game session and/or plan to restart it later.
TK.Shutdown();You can also provide your own ITweenEngine implementation or use default TweenEngine outside of TK utility and fluent API if you prefer custom tick control.
Animate any VisualElement with fluent extension methods. Every tween returns a Tweener<T> that can be further configured.
VisualElement element = ...;
element.ToOpacity(0f).SetDuration(0.5f);
element.ToScale(1.5f).SetDuration(0.3f).SetEase(Ease.OutBack);
element.ToPosition(new Vector2(100f, 200f)).SetDuration(1f);Use By* methods to animate relative to the current value:
element.ByPosition(new Vector2(50f, 0f)).SetDuration(0.5f);
element.ByRotation(90f).SetDuration(0.3f);ToOpacity/ByOpacityToScale/ByScale(floatorVector2)ToPosition/ByPositionToRotation/ByRotationToSize/BySizeToWidth/ByWidthToHeight/ByHeightToFlexGrow/ByFlexGrowToFlexShrink/ByFlexShrinkToMargin/ByMarginToPadding/ByPaddingToTranslate/ByTranslateToBackgroundColor/ByBackgroundColor
ToTextColor/ByTextColor
ToTypewriter— reveals text character-by-character
Chain configuration:
element.ToOpacity(0f)
.SetDuration(1f)
.SetDelay(0.5f)
.SetEase(Ease.InOutQuad)
.SetLoops(3, LoopType.Yoyo);Built-in easing functions cover the standard set. By default, ease used is Ease.Linear:
element.ToScale(2f).SetEase(Ease.OutElastic);You can also provide custom easing delegates:
element.ToOpacity(0f).SetEase(t => t * t);Or combine separate in/out eases:
element.ToOpacity(0f).SetEase(Ease.InQuad, Ease.OutCubic);.SetLoops(5, LoopType.Restart) // Play 5 times from start
.SetLoops(-1, LoopType.Yoyo) // Loop forever, reversing each timeTweener<float> tween = element.ToOpacity(0f).SetDuration(1f);
tween.OnComplete += () => Debug.Log("Done!");
tween.OnUpdate += () => Debug.Log("Tween updated");Chain tweens and callbacks in time with Sequence:
Sequence seq = TK.Sequence();
seq.Append(element.ToOpacity(0f).SetDuration(0.5f))
.AppendInterval(0.2f)
.Append(element.ToOpacity(1f).SetDuration(0.5f))
.AppendCallback(() => Debug.Log("Sequence finished"))
.Play();Append— adds a tween or callback after the previous item ends.Join— adds a tween that starts at the same time as the previous item.Insert— places a tween or callback at an explicit time offset.
tween.Pause();
tween.Play(); // resumes from pause
tween.Kill(); // stops and marks for removal
tween.Complete(); // jumps to end, fires OnComplete and kills the tweenKill all active tweens:
TK.KillAll();For unit tests or custom update loops, use ManualTweenTicker:
ManualTweenTicker ticker = new ManualTweenTicker();
TweenEngine engine = new TweenEngine(ticker);
TK.Initialize(engine); // Optional - only if you plan to use fluent API
ticker.TickManual(0.5f); // advance time by 0.5 secondsYou can also tick tweens and sequences directly without using engine at all.
MIT License — see LICENSE for details.