Hi,
I’m unsure how I should add an ease type to my tween function?
Here’s my script:
private void UpdatePowerbarFill(float score)
{
if (powerbarFillTween != null) powerbarFillTween.Kill();
powerbarFillTween = DOVirtual.Float(powerbar_Mat.GetFloat("FillRate"), score, fillTweenDuration, (float val) => {
powerbar_Mat.SetFloat("FillRate", val);
}).OnComplete(() => {
powerbarFillTween = null;
});
}
When looking online it seems as though I should be able to add it as an extension, but I’m getting errors when I try this:
powerbarFillTween = DOVirtual.Float(powerbar_Mat.GetFloat("FillRate"), score, fillTweenDuration, (float val).SetEase<>(Ease.InOutElastic) => {
powerbar_Mat.SetFloat("FillRate", val);
Does anyone know how to do this correctly?
Thanks!