$ show KyryloKuzyk/PrimeTween
PrimeTween is a high-performance Unity tweening and animation framework. In production it animates Transform positions/rotations/scales, UI Toolkit elements, materials, AudioSource properties, cameras, custom values, and supports shake effects, delays, cycles, and sequences. Its core design eliminates per-tween garbage allocation: the static Tween API uses struct-based handles and non-allocating OnComplete callbacks, while TweenSettings<T> structs are serializable so animations can be configured in the Unity Inspector. The library also includes an async/coroutine bridge and a DOTween-compatible adapter enabled via compiler define, making it both a drop-in replacement and a migration path from the established DOTween ecosystem. The repository is architecturally a Unity package plus a dedicated benchmark sub-project that uses Unity.PerformanceTesting to compare PrimeTween again DOTween, LeanTween, MagicTween, UnityTweens, and UI Toolkit.
The LLM identified 4 files worth highlighting for reuse:
The central Tween static facade is the main entry point for all animations: PositionY, Custom, Delay, ShakeCamera, etc. It demonstrates a clean zero-allocation factory pattern where tweens are returned as lightweight structs with an isAlive flag, avoiding heap allocations per tween tick. The OnComplete(target, callback) overloads eliminate closure captures, making this class a strong reference model for allocation-sensitive C# APIs in Unity.
Sequence.Create provides a fluent builder for complex animation choreography with Group(), Chain(), and Insert() operations. It cleanly composes tweens into sequential, parallel, or overlapping timelines while preserving the zero-allocation and precise timing guarantees of the library. This is a safely reusable orchestration pattern for any Unity animation or event-timing system.
TweenSettings<T> and ShakeSettings are serializable structs that bridge the code API with Unity's Inspector workflow. They allow designers to configure tweens without writing code, while the same structs feed directly into the runtime engine. This is a well-crafted example of configuration-as-data in a Unity ecosystem and can be extracted as a pattern for inspector-driven runtime systems.
The benchmark suite uses Unity.PerformanceTesting to measure frame time, start time, and GC allocations of identical animation workloads across PrimeTween, DOTween, LeanTween, MagicTween, and UnityTweens. The test pattern is self-contained and demonstrates how to build reproducible, allocation-aware performance comparisons for Unity systemsβa reusable template for any team validating performance claims.