// Reset state between runs so we don't have random colors from last call everywhere private Tween[] GetResetTweens(CharTweener charTweener) { Tween[] resets = new Tween[text.text.Length]; for (int i = 0; i < text.text.Length; i++) { resets[i] = DOTween.Sequence() .Append(charTweener.DOColor(i, Color.white, 0)) .Append(charTweener.DOCircle(i, 0, 0)); } return(resets); }
public void Wave(int start, int end, float speed, float radius = 6) { for (var i = start; i <= end; ++i) { var timeOffset = Mathf.Lerp(0, 1, (i - start) / (float)(end - start + 1)); var circleTween = _tweener.DOCircle(i, radius, speed) .SetEase(Ease.Linear) .SetLoops(-1, LoopType.Restart); circleTween.fullPosition = timeOffset; lastAnimations.Add(circleTween); } }
// Basic example 1, oscillating characters and color private void Tween1(int start, int end) { for (var i = start; i <= end; ++i) { var timeOffset = Mathf.Lerp(0, 1, (i - start) / (float)(end - start + 1)); var circleTween = _tweener.DOCircle(i, radius, 0.5f) .SetEase(Ease.Linear) .SetLoops(-1, LoopType.Restart); var colorTween = _tweener.DOColor(i, Color.yellow, 0.5f) .SetLoops(-1, LoopType.Yoyo); circleTween.fullPosition = timeOffset; colorTween.fullPosition = timeOffset; } }