A tweening library for Unity designed to be simple to use and extend.
Created as an alternative to DOTween, which has a proprietary license with some limitations. PeachyTween intends to create a similarly powerful tweening library that can be installed by UPM and allows public forks and distribution.
PeachyTween does not aim to be API compatible with DOTween, nor to fully mirror its functionality.
Package can be installed from OpenUPM using OpenUPM CLI;
$ openupm add computer.rhys.peachy-tween
To add to you Unity project, first add the internal dependency ecslite.
In Unity package manager, select "Add package from git URL..." and add the following two URLs:
https://github.com/LeoECSCommunity/ecslite.git#1.0.0
https://github.com/rhys-vdw/peachy-tween.git
Or add the following two lines to dependencies
in your manifest.json
:
"dependencies": {
"com.leoecscommunity.ecslite": "https://github.com/LeoECSCommunity/ecslite.git#1.0.0",
"computer.rhys.peachy-tween": "https://github.com/rhys-vdw/peachy-tween.git",
Installation will streamlined before full release.
using UnityEngine;
using PeachyTween;
public class PeachyExample : MonoBehaviour
{
void Start()
{
Peachy.Tween(
from: 0f,
to: 5f,
duration: 4f,
onChange: v => Debug.Log($"value = {v}")
);
transform
.TweenLocalRotation(Quaternion.Euler(90, 90, 90), 2f)
.Slerp()
.Ease(Ease.BounceInOut)
.Loop(4)
.OnLoop(() => Debug.Log("Loop complete"))
.OnKill(() => Debug.Log("Four loops complete"));
}
}
Contributions welcome. If you wish to make a pull request, please open an issue first.
See the GitHub project for the development roadmap.
To work on PeachyTween:
- Clone the GitHub repo.
- Create a new Unity project.
- In the package manager window, select "Add package from disk..." and select your local PeachyTween folder.
- Enable tests in the editor (see below).
Contributions should have test coverage. To run the test suite, edit your project's manifest.json
to include the following entry:
"testables": [
"computer.rhys.peachy-tween"
]