(WIP) Tween engine for Unity based on the C# Job System.
- Supports tweening
float
,Vector2
,Vector3
,Vector4
,Quaternion
,Color
andRect
values - Highly configurable: easing function, duration, animation speed,
deltaTime
vsunscaledDeltaTime
, repeat vs ping-pong loops - Tweeners are serializable C# classes that can be easily embedded in your own components
- Ready-made tween components with embedded tweeners for ease of integration
- Tween math runs in parallel jobs using the C# Job System. Jobs are compiled with Burst for maximum performance
- Update Manager: Update Manager is used to manage tween jobs
- Burst: used to compile jobs
- Unity Mathematics: math library
Either:
- Use the openupm registry and install this package using the openupm-cli:
openupm add com.gilzoide.tween-jobs
- Install using the Unity Package Manager with the following URL:
https://github.com/gilzoide/unity-tween-jobs.git#1.0.0-preview4
- Clone this repository or download a snapshot of it directly inside your project's
Assets
orPackages
folder.
// MySpriteColorTween.cs
using System;
using Gilzoide.TweenJobs;
using UnityEngine;
// 1. Create a serializable class that inherits A*Tweener
// Supported tween types: float, Vector2, Vector3, Vector4, Quaternion, Color and Rect
[Serializable]
public class MySpriteColorTweener : AColorTweener
{
public SpriteRenderer targetSprite;
// 2. Implement the `Value` property
public override Color Value
{
get => targetSprite.color;
set => targetSprite.color = value;
}
}
// 3. (optional) Create a wrapper component for your tweener
public class MySpriteColorTween : ATweenComponent<MySpriteColorTweener>
{
}
// 4. Use your tweener/tween component just like the builtin ones.
// Enjoy 🍾