July 4, 2023
GitHub - yjlintw/Tweenie at v0.0.7
An exciting new feature in Tweenie that simplifies the management of multiple tweeners in Unity projects. Say goodbye to tedious individual handling and welcome tag-based bulk manipulation.
With this update, you can assign tags to tweeners upon creation, enabling easy control of multiple tweeners sharing the same tag. No more manual references or repetitive tasks!
API
public static ITweener To<T>(
Action<T> param,
T fromValue, T toValue,
float duration,
Func<T,T,float,T> lerpFunc,
object tag = null)
public static void PlayTweenerTag(object tag)
public static void PauseTweenerTag(object tag)
public static void StopTweenerTag(object tag)
public static void CompleteTweenerTag(object tag)
Example
public class MultiTweenerExample : MonoBehaviour
{
private void OnEnable()
{
Tweenie.PlayTweenerTag(this);
}
// Start is called before the first frame update
void Start()
{
Tweenie.To(
x => { transform.localRotation = Quaternion.Euler(0, x, 0); },
0,
360,
1.0f,
this)
.SetLoop(Loop.PingPong);
Tweenie.To(
x => transform.position = x,
transform.position,
transform.position + new Vector3(5, 5, 5),
1.0f,
this)
.SetLoop(Loop.PingPong);
Tweenie.To(
x => transform.localScale = x,
new Vector3(1, 1, 1),
new Vector3(2f, 2f, 5f),
1.0f,
this)
.SetLoop(Loop.PingPong);
}
private void OnDisable()
{
Tweenie.PauseTweenerTag(this);
}
private void OnDestroy()
{
Tweenie.RemoveTag(this);
}
}
Not in any particular order
AnimationCurve to allow different ease in / out animationTweener objects to avoid garbage collection (?)