Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
修复2020不支持的新语法
Browse files Browse the repository at this point in the history
  • Loading branch information
Giresharu committed Jun 26, 2023
1 parent db1b11a commit 44e8ae7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Assets/Runtime/TMProPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ public void SetText(string text, bool isAdditive = false, bool newline = false)
/// </summary>
/// <param name="invokeSingleActions"> 是否需要执行跳过的文字中的单个标签 </param>
public void Skip(bool invokeSingleActions = true) {
if (typeWriterTokenSource is not { IsCancellationRequested: false }) return;
if (typeWriterTokenSource == null || typeWriterTokenSource.IsCancellationRequested) return;
// if (typeWriterTokenSource is not { IsCancellationRequested: false }) return;

typeWriterTokenSource.Cancel();
typeWriterTokenSource.Dispose();
Expand Down Expand Up @@ -346,7 +347,7 @@ void ShowText(bool isAdditive = false) {
lastInvokeIndex = TextMeshPro.text.Length - 1;
// AddUpdateFlags(TMP_VertexDataUpdateFlags.Colors32);
}

// 触发成对 Action
foreach (var tuple in pairedActions.Keys)
tuple.actionInfo.Invoke(this, actionTokenSource.Token, pairedActions[tuple], tuple.value);
Expand Down Expand Up @@ -497,7 +498,9 @@ IEnumerator TypeWriter(CancellationToken token) {
Stack<int> temp = new Stack<int>();

while (true) {
if (!tagIndices.TryPop(out int i)) break;
if (tagIndices.Count <= 0) break;
int i = tagIndices.Pop();
// if (!tagIndices.TryPop(out int i)) break;

RichTagInfo richTagInfo = textTags[i];

Expand Down

0 comments on commit 44e8ae7

Please sign in to comment.