-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Made by UnBocal - LUPON Dylan
Unity 2022.3.62f2 or greater
Small tweening system made for Unity inspired by DoTween and the Ama Motion Automatiser.
The UBTweening System (for Un Bocal Tweening System) is an coroutine based interpolation manager. It can be used to make simple animations from code.
I wanted to make my own tweening system, since i used to make all my juiciness with tweens.
You can download the plugin here on the github page. This plugin was made for Unity 2022.3.62f2 or greater.
The UBTweening System is for moment only usable through scripts.
Before doing anything, you need to get the UnBocal.Tweening namespace.
using UnBocal.Tweening;Each interpolation method is static and can be called from the UBTween class.
Here is an exemple of a tween interpolating the Position :
// Interpolate The Transform Position From Current Position To The Target Position In 1 Second
UBTween.Position(transform, transform.position, Vector3.up, 1f);
// An Other Way Of Doing The Same Action
UBTween.Position(transform, Vector3.up, 1f);To control the behavior of an interpolation you can use the controls method at the end of the instruction such as :
SetDelay(float duration) :
To add a delay before the execution of the interpolation.
// Start Interpolate After delay seconds
UBTween.Position(transform, Vector3.up, 1f)
.SetDelay(1f);Note that for the moment, the start position will be the position of the transform at the moment where the method is called.
SetEase(EaseType ease) :
To ease the interpolation and give it a little style. :]
// Ease The Interpolation
UBTween.Position(transform, Vector3.up, 1f)
.SetEase(EaseType.InOutExpo);
SetCurve(AnimationCurve curve)
To ease the interpolation following a curve.
// Ease The Interpolation Based On A Curve
UBTween.Position(transform, Vector3.up, 1f)
.SetCurve(curve);
SetLoop()
To loop the interpolation.
// Every
UBTween.Position(transform, targetPosition, 1f)
.SetLoop()// Start Interpolate After delay seconds
UBTween.Position(transform, Vector3.up, 1f)
.SetDelay(1f)
.SetEase(EaseType.InOutExpo)You have three callbacks possible :
OnStart(UnityAction method) :
Will be called when the interpolation starts (After the delay).
UBTween.Position(transform, Vector3.up, 1f)
.OnStart(method);
OnLoop(UnityAction method) :
Will be called at the end of every loop.
UBTween.Position(transform, Vector3.up, 1f)
.SetLoop()
.OnLoop(method);
OnFinished(UnityAction method) :
Will be called when the interpolation stops.
UBTween.Position(transform, Vector3.up, 1f)
.OnFinished(method);