質問編集履歴

1

DoTweenのコードを追記しました。

2022/06/05 23:33

投稿

adisov
adisov

スコア0

test CHANGED
File without changes
test CHANGED
@@ -34,6 +34,7 @@
34
34
  public string SoundAddress;
35
35
  }
36
36
 
37
+ //トリガー文字判定処理
37
38
  private async UniTask<List<TextEventStruct>> SoundStringDecision(string text, CancellationToken token)
38
39
  {
39
40
  bool isFindSound = false;
@@ -112,7 +113,29 @@
112
113
  }
113
114
  }
114
115
 
116
+ //DoTweenテキスト表示処理
117
+ private async UniTask TextScaleUpAnim(TextMeshProUGUI contentsText, List<TextEventStruct> soundStructList, CancellationToken token)
118
+ {
115
119
 
120
+ bool isComplete = false;
121
+ int count = 0;
122
+ DOTweenTMPAnimator tmproAnimator = new DOTweenTMPAnimator(contentsText);
123
+
124
+ var sequence = DOTween.Sequence();
125
+ for (int i = 0; i < tmproAnimator.textInfo.characterCount; i++)
126
+ {
127
+ tmproAnimator.SetCharScale(i, Vector3.zero);
128
+ sequence
129
+ .Join(tmproAnimator.DOScaleChar(i, Vector3.one, _appearTime).SetDelay(0.1f))
130
+ .Join(tmproAnimator.DOFadeChar(i, 1, _appearTime).SetDelay(0.1f));
131
+ }
132
+ sequence
133
+ .AppendInterval(3)
134
+ .AppendCallback(() => _eventParamCount++)
135
+ .OnComplete(() => isComplete = true);
136
+ await UniTask.WaitWhile(() => !isComplete);
137
+
138
+ }
116
139
  ```
117
140
 
118
141
  ### 試したこと