Equivalent of Ease.Flash #81
-
Hi @KyryloKuzyk , |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hey @meturgut Can you please provide a usage example? I'm currently trying to understand how to properly use the Ease.Flash, and it seems like the same as using multiple cycles on a tween. These two animations produce visually the same results, for example: // DOTween:
transform.DOMove(new Vector3(0, 5), 1f).SetEase(Ease.InFlash, overshoot: 5);
// PrimeTween:
Tween.Position(transform, new Vector3(0, 5), 1f / 5f, Ease.InSine, cycles: 5, cycleMode: CycleMode.Rewind); Are there any differences between Ease.Flash and using multiple animation cycles? |
Beta Was this translation helpful? Give feedback.
-
I want to convert code previously written using DoTween to PrimeTween. (Only move functions used) The example you created using "Ease.InFlash" is not exactly the same animation, but it is quite similar. The code below looks like the exact equivalent // DOTween:
transform.DOMove(new Vector3(0, 5), 1f).SetEase(Ease.InFlash, overshoot: 5);
// PrimeTween:
Tween.Position(transform, new Vector3(0, 5), 1f / 5f, Ease.InQuad, cycles: 5, cycleMode: CycleMode.Rewind); What are the equivalents of "OutFlash" and "InOutFlash"? block.transform.DOMove(targetPos, duration).SetEase(Ease.OutFlash);
block.transform.DOMove(targetPos, duration).SetEase(Ease.InOutFlash); |
Beta Was this translation helpful? Give feedback.
-
You've probably figured it out by yourself, but this should be similar to the Ease.InFlash equivalent you provided, but with OutQuad and InOutQuad eases: Tween.Position(transform, new Vector3(0, 5), 1f / 5f, Ease.OutQuad, cycles: 5, cycleMode: CycleMode.Rewind);
Tween.Position(transform, new Vector3(0, 5), 1f / 5f, Ease.InOutQuad, cycles: 5, cycleMode: CycleMode.Rewind); |
Beta Was this translation helpful? Give feedback.
-
For anyone looking for the Flash 'period' parameter equivalent, you can achieve the same effect in PrimeTween with this custom code: const float duration = 3f;
const int cycles = 11;
Tween.Custom(0f, 1f, duration / cycles, _ => { }, Ease.InSine, cycles, CycleMode.Yoyo).OnUpdate(image, (_image, tween) => {
// oscillation amplitude will increase over time. Use '1 - tween.progressTotal' for decreasing amplitude
float amplitude = tween.progressTotal;
_image.color = Color.Lerp(Color.white, Color.red, tween.interpolationFactor * amplitude);
}); |
Beta Was this translation helpful? Give feedback.
Hey @meturgut
Can you please provide a usage example? I'm currently trying to understand how to properly use the Ease.Flash, and it seems like the same as using multiple cycles on a tween. These two animations produce visually the same results, for example:
Are there any differences between Ease.Flash and using multiple animation cycles?