private Sequence FeverColorfulTextTewwn() { var seq = DOTween.Sequence(); var tmproAnimator = new DOTweenTMPAnimator(_targetText); for (int i = 0; i < tmproAnimator.textInfo.characterCount; i++) { Vector3 currCharOffset = tmproAnimator.GetCharOffset(i); var charSeq = DOTween.Sequence(); charSeq.Append(tmproAnimator.DOColorChar(i, Color.red, 0.1f)); charSeq.Append(tmproAnimator.DOColorChar(i, Color.yellow, 0.1f)); charSeq.Append(tmproAnimator.DOColorChar(i, Color.green, 0.1f)); charSeq.Append(tmproAnimator.DOColorChar(i, Color.blue, 0.1f)); charSeq.Append(tmproAnimator.DOColorChar(i, Color.magenta, 0.1f)); charSeq.SetRelative().SetLoops(100); seq.Join(charSeq.SetDelay(i * 0.1f)); } return(seq); }
private void Start() { var highlightColor = new Color(1f, 1f, 0.8f); var textAnimation = new DOTweenTMPAnimator(titleName); var sequences = new Sequence[textAnimation.textInfo.characterCount]; for (int i = 0; i < sequences.Length; i++) { var interval = i * 0.05f; sequences[i] = DOTween.Sequence() .AppendInterval(2.0f) .Append(textAnimation .DOColorChar(i, highlightColor, 0.1f) .SetLoops(2, LoopType.Yoyo) .SetDelay(interval)) .AppendInterval(3.0f - interval) .SetLoops(-1); } this.OnDisableAsObservable() .Subscribe(_ => { foreach (var sequence in sequences) { sequence?.Kill(); } }) .AddTo(this); }
// Start is called before the first frame update void Start() { var target = GetComponent <TextMeshProUGUI>(); DOTweenTMPAnimator animator = new DOTweenTMPAnimator(target); Sequence sequence = DOTween.Sequence(); for (int i = 0; i < animator.textInfo.characterCount; ++i) { if (!animator.textInfo.characterInfo[i].isVisible) { continue; } Vector3 currCharOffset = animator.GetCharOffset(i); sequence.Append(animator.DOOffsetChar(i, currCharOffset + new Vector3(0, 5, 0), animationTime)); sequence.Join(animator.DOColorChar(i, Color.yellow, animationTime)); sequence.Append(animator.DOOffsetChar(i, currCharOffset + new Vector3(0, -5, 0), animationTime)); sequence.Join(animator.DOColorChar(i, Color.white, animationTime)); } sequence.SetLoops(-1, LoopType.Yoyo); }
//Start is called before the first frame update void Start() { DOTweenTMPAnimator Animator = new DOTweenTMPAnimator(TitleText); for (int i = 0; i < Animator.textInfo.characterCount; i++) //for分で透明度の値を変える(Fade) { DOTween.Sequence(). //Seqence = 一回のアニメーションをまとめるもの Append(Animator.DOFadeChar(i, 1, 2f)) //テキストの透明度をだんだん上げていく .Join(Animator.DOOffsetChar(i, Vector3.up * 20, 1f).SetEase(Ease.InOutFlash, 2)) //文字を個別に少し跳ねさせる .AppendInterval(0.4f) .Append(Animator.DOColorChar(i, new Color(1f, 0.5f, 1f), 0.2f).SetEase(Ease.OutFlash, 2)) //DoColorCharとEase.OutFlashで光が走る様にする .SetDelay(i * 0.1f); } }
private async UniTask TweenClearTextAsync(CancellationToken token) { var tasks = new List <UniTask>(); var textAnimation = new DOTweenTMPAnimator(clearText); var offset = Vector3.up * 40.0f; var charCount = textAnimation.textInfo.characterCount; for (int i = 0; i < charCount; i++) { tasks.Add(DOTween.Sequence() .Append(textAnimation .DOOffsetChar(i, textAnimation.GetCharOffset(i) + offset, Const.CLEAR_TEXT_ANIMATION_TIME) .SetEase(Ease.OutFlash, 2)) .Join(textAnimation .DOFadeChar(i, 1, Const.CLEAR_TEXT_ANIMATION_TIME)) .SetDelay(i * 0.04f) .WithCancellation(token)); } _seController.PlaySe(SeType.Clear); await UniTask.WhenAll(tasks); var highlightColor = new Color(1f, 1f, 0.8f); for (int i = 0; i < charCount; i++) { var interval = i * 0.05f; DOTween.Sequence() .AppendInterval(0.5f) .Append(textAnimation .DOColorChar(i, highlightColor, 0.15f) .SetLoops(2, LoopType.Yoyo) .SetDelay(interval)) .AppendInterval(3.0f - interval) .SetLoops(-1) .DisableKill(this); } await UniTask.Delay(TimeSpan.FromSeconds(0.25f), cancellationToken : token); _seController.PlaySe(SeType.Flash); }
public void Play() { var highlightColor = new Color(1.0f, 1.0f, 0.8f); var targetText = GetComponent <TextMeshProUGUI>(); var textAnimation = new DOTweenTMPAnimator(targetText); for (int i = 0; i < textAnimation.textInfo.characterCount; i++) { var interval = i * 0.05f; DOTween.Sequence() .AppendInterval(1.0f) .Append(textAnimation .DOColorChar(i, highlightColor, 0.1f) .SetLoops(2, LoopType.Yoyo) .SetDelay(interval)) .AppendInterval(2.0f - interval) .SetLoops(-1) .SetLink(gameObject); } }