From db1b11ae241c00c24e303090726409c812a937a7 Mon Sep 17 00:00:00 2001 From: Giresharu Date: Mon, 26 Jun 2023 15:12:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIcon=E7=89=B9=E6=80=A7?= =?UTF-8?q?=E5=9C=A8=E6=97=A7=E7=89=88=E6=9C=AC=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Runtime/TMPPlayerRichTagManager.cs | 3 +-- Assets/Runtime/TMPPlayerRichTagManager.cs.meta | 10 +++++++++- Assets/Runtime/TMProPlayer.cs | 2 +- Assets/Runtime/TMProPlayer.cs.meta | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Assets/Runtime/TMPPlayerRichTagManager.cs b/Assets/Runtime/TMPPlayerRichTagManager.cs index 5332100..be6e439 100644 --- a/Assets/Runtime/TMPPlayerRichTagManager.cs +++ b/Assets/Runtime/TMPPlayerRichTagManager.cs @@ -7,8 +7,7 @@ using UnityEngine; namespace TMPPlayer { - - [Icon("Packages/com.gsr.tmproplayer/Icons/manager.png")] + public class TMPPlayerRichTagManager : MonoBehaviour { static TMPPlayerRichTagManager instance; diff --git a/Assets/Runtime/TMPPlayerRichTagManager.cs.meta b/Assets/Runtime/TMPPlayerRichTagManager.cs.meta index 32522c8..988f69d 100644 --- a/Assets/Runtime/TMPPlayerRichTagManager.cs.meta +++ b/Assets/Runtime/TMPPlayerRichTagManager.cs.meta @@ -1,3 +1,11 @@ fileFormatVersion: 2 guid: bd857d0e2e734516b9b37866f29757b6 -timeCreated: 1680020156 \ No newline at end of file +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 8f8cee23ea1215843908aced1efddadb, type: 3} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Runtime/TMProPlayer.cs b/Assets/Runtime/TMProPlayer.cs index 11de06f..d090cd4 100644 --- a/Assets/Runtime/TMProPlayer.cs +++ b/Assets/Runtime/TMProPlayer.cs @@ -9,7 +9,7 @@ namespace TMPPlayer { - [RequireComponent(typeof(TMP_Text))][Icon("Packages/com.gsr.tmproplayer/Icons/player.png")] + [RequireComponent(typeof(TMP_Text))] public class TMProPlayer : MonoBehaviour { public bool isTypeWriter = true; diff --git a/Assets/Runtime/TMProPlayer.cs.meta b/Assets/Runtime/TMProPlayer.cs.meta index 0bec3a6..90e3d2f 100644 --- a/Assets/Runtime/TMProPlayer.cs.meta +++ b/Assets/Runtime/TMProPlayer.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: f294c84116e5f9a419d1ff3cc852dc89, type: 3} userData: assetBundleName: assetBundleVariant: From 44e8ae7f4879fac966d6ca5ffb49316638c9275b Mon Sep 17 00:00:00 2001 From: Giresharu Date: Mon, 26 Jun 2023 15:30:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D2020=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9A=84=E6=96=B0=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Runtime/TMProPlayer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Assets/Runtime/TMProPlayer.cs b/Assets/Runtime/TMProPlayer.cs index d090cd4..bc667cd 100644 --- a/Assets/Runtime/TMProPlayer.cs +++ b/Assets/Runtime/TMProPlayer.cs @@ -194,7 +194,8 @@ public void SetText(string text, bool isAdditive = false, bool newline = false) /// /// 是否需要执行跳过的文字中的单个标签 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(); @@ -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); @@ -497,7 +498,9 @@ IEnumerator TypeWriter(CancellationToken token) { Stack temp = new Stack(); 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]; From de1563c78ddda5f89cc40f34e76eff318a91d75d Mon Sep 17 00:00:00 2001 From: Giresharu Date: Mon, 26 Jun 2023 15:56:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9ReadMe=E7=AD=89=E8=87=B31?= =?UTF-8?q?.1.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/CHANGELOG-en.md | 10 ++++++++-- Assets/CHANGELOG.md | 6 ++++++ Assets/README-en.md | 6 +++--- Assets/README.md | 7 ++++--- Assets/package.json | 2 +- CHANGELOG-en.md | 10 ++++++++-- CHANGELOG.md | 6 ++++++ README-en.md | 6 +++--- README.md | 6 +++--- 9 files changed, 42 insertions(+), 17 deletions(-) diff --git a/Assets/CHANGELOG-en.md b/Assets/CHANGELOG-en.md index bc84ee5..c1c6312 100644 --- a/Assets/CHANGELOG-en.md +++ b/Assets/CHANGELOG-en.md @@ -2,16 +2,22 @@ TMPro-Player === [查看中文版本](./CHANGELOG.md) +[1.1.4](https://github.com/Giresharu/TMPro-Player/releases/1.1.4) +--- + +### Fixed +* Fixed various compatibility issues in Unity 2020.x version. + [1.1.3](https://github.com/Giresharu/TMPro-Player/releases/1.1.3) --- -### 修复 +### Fixed * Fixed the issue of incorrectly merge-optimizing of nested or interleaved paired tags. [1.1.2](https://github.com/Giresharu/TMPro-Player/releases/1.1.2) --- -### 修复 +### Fixed * I made a silly mistake, accidentally typed an extra character. It's fixed now. [1.1.1](https://github.com/Giresharu/TMPro-Player/releases/1.1.1) diff --git a/Assets/CHANGELOG.md b/Assets/CHANGELOG.md index 8fb1474..caf42b5 100644 --- a/Assets/CHANGELOG.md +++ b/Assets/CHANGELOG.md @@ -2,6 +2,12 @@ TMPro-Player === [View in English](./CHANGELOG-en.md) +[1.1.4](https://github.com/Giresharu/TMPro-Player/releases/1.1.4) +--- + +### 修复 +* 修复了在 unity 2020.x 版本中的各种不兼容问题 + [1.1.3](https://github.com/Giresharu/TMPro-Player/releases/1.1.3) --- diff --git a/Assets/README-en.md b/Assets/README-en.md index 583bd55..4640759 100644 --- a/Assets/README-en.md +++ b/Assets/README-en.md @@ -1,6 +1,6 @@ ![LOGO](./logo.png) === -[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player.svg)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg) +[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player?logo=github)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg?logo=unity) [![bilibili](https://img.shields.io/badge/bilibili-Overview_Video(in_Chinese)-FE7398?logo=bilibili&logoColor=white)](https://www.bilibili.com/video/BV1mV4y117jG/) [查看中文版](./README.md) @@ -60,7 +60,7 @@ In your project's root directory, use the following command: # Install the latest version openupm add com.gsr.tmproplayer # Install a specific version -openupm add com.gsr.tmproplayer@1.1.3 +openupm add com.gsr.tmproplayer@1.1.4 ``` If you are using a modified version of `com.unity.textmeshpro` and it is not recognized as a dependency, please use the following command to install: @@ -73,7 +73,7 @@ openupm add com.gsr.tmproplayer -f In the Unity engine, open the `Package Manager` and click on the `+` button in the top left corner. Choose `Add package from git URL` and enter the git URL of this project: ```shell -https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.3 +https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.4 ``` It is recommended to specify the version number when installing via Git URL to avoid automatically updating to the latest repository instead of the latest version. This ensures that you install a stable repository. diff --git a/Assets/README.md b/Assets/README.md index 72c4195..6d3cb88 100644 --- a/Assets/README.md +++ b/Assets/README.md @@ -1,6 +1,7 @@ ![LOGO](./logo.png) === -[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player.svg)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg) + +[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player?logo=github)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg?logo=unity) [![bilibili](https://img.shields.io/badge/bilibili-介绍视频-FE7398?logo=bilibili&logoColor=white)](https://www.bilibili.com/video/BV1mV4y117jG/) [View in English](./README-en.md) @@ -58,7 +59,7 @@ TMPro Player 是一款基于 TextMeshPro 的富文本标签管理插件,实现 # 安装最新版本 openupm add com.gsr.tmproplayer # 安装指定版本 -openupm add com.gsr.tmproplayer@1.1.3 +openupm add com.gsr.tmproplayer@1.1.4 ``` 如果你使用了魔改的 `com.unity.textmeshpro` ,并且无法正确被识别为依赖时,请使用如下命令安装: @@ -71,7 +72,7 @@ openupm add com.gsr.tmproplayer -f 在 Unity 引擎中,打开 `Package Manager` ,点击左上角的 `+` ,选择 `Add package from git URL` ,然后输入本项目的 git 地址即可: ```shell -https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.3 +https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.4 ``` 建议使用 git URL 安装时指定版本号,否则会默认更新为最新仓库,而非最新版本。有可能会安装不稳定的仓库。 diff --git a/Assets/package.json b/Assets/package.json index c573745..c74719b 100644 --- a/Assets/package.json +++ b/Assets/package.json @@ -1,7 +1,7 @@ { "name": "com.gsr.tmproplayer", "displayName": "TMPro Player", - "version": "1.1.3", + "version": "1.1.4", "unity": "2020.1", "description": "基于 TextMeshPro 的自定义富文本标签插件\nCustom Rich Text Tag Plugin Based on TextMeshPro", "keywords": [ diff --git a/CHANGELOG-en.md b/CHANGELOG-en.md index bc84ee5..c1c6312 100644 --- a/CHANGELOG-en.md +++ b/CHANGELOG-en.md @@ -2,16 +2,22 @@ TMPro-Player === [查看中文版本](./CHANGELOG.md) +[1.1.4](https://github.com/Giresharu/TMPro-Player/releases/1.1.4) +--- + +### Fixed +* Fixed various compatibility issues in Unity 2020.x version. + [1.1.3](https://github.com/Giresharu/TMPro-Player/releases/1.1.3) --- -### 修复 +### Fixed * Fixed the issue of incorrectly merge-optimizing of nested or interleaved paired tags. [1.1.2](https://github.com/Giresharu/TMPro-Player/releases/1.1.2) --- -### 修复 +### Fixed * I made a silly mistake, accidentally typed an extra character. It's fixed now. [1.1.1](https://github.com/Giresharu/TMPro-Player/releases/1.1.1) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb1474..caf42b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ TMPro-Player === [View in English](./CHANGELOG-en.md) +[1.1.4](https://github.com/Giresharu/TMPro-Player/releases/1.1.4) +--- + +### 修复 +* 修复了在 unity 2020.x 版本中的各种不兼容问题 + [1.1.3](https://github.com/Giresharu/TMPro-Player/releases/1.1.3) --- diff --git a/README-en.md b/README-en.md index 8f8703f..ff8ff87 100644 --- a/README-en.md +++ b/README-en.md @@ -1,6 +1,6 @@ ![LOGO](./Assets/logo.png) === -[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player.svg)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg) +[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player?logo=github)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg?logo=unity) [![bilibili](https://img.shields.io/badge/bilibili-Overview_Video(in_Chinese)-FE7398?logo=bilibili&logoColor=white)](https://www.bilibili.com/video/BV1mV4y117jG/) [查看中文版](./README.md) @@ -60,7 +60,7 @@ In your project's root directory, use the following command: # Install the latest version openupm add com.gsr.tmproplayer # Install a specific version -openupm add com.gsr.tmproplayer@1.1.3 +openupm add com.gsr.tmproplayer@1.1.4 ``` If you are using a modified version of `com.unity.textmeshpro` and it is not recognized as a dependency, please use the following command to install: @@ -73,7 +73,7 @@ openupm add com.gsr.tmproplayer -f In the Unity engine, open the `Package Manager` and click on the `+` button in the top left corner. Choose `Add package from git URL` and enter the git URL of this project: ```shell -https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.3 +https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.4 ``` It is recommended to specify the version number when installing via Git URL to avoid automatically updating to the latest repository instead of the latest version. This ensures that you install a stable repository. diff --git a/README.md b/README.md index e96b359..1239c03 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![LOGO](./Assets/logo.png) === -[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player.svg)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg) +[![Releases](https://img.shields.io/github/v/release/Giresharu/TMPro-Player?logo=github)](https://github.com/Giresharu/TMPro-Player/releases/latest) [![openupm](https://img.shields.io/npm/v/com.gsr.tmproplayer?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.gsr.tmproplayer/) [![LICENSE](https://img.shields.io/github/license/Giresharu/TMPro-Player)](./LICENSE.md) ![Unity](https://img.shields.io/badge/Unity%20Supported-2020.1%2B-ff69b4.svg?logo=unity) [![bilibili](https://img.shields.io/badge/bilibili-介绍视频-FE7398?logo=bilibili&logoColor=white)](https://www.bilibili.com/video/BV1mV4y117jG/) [View in English](./README-en.md) @@ -58,7 +58,7 @@ TMPro Player 是一款基于 TextMeshPro 的富文本标签管理插件,实现 # 安装最新版本 openupm add com.gsr.tmproplayer # 安装指定版本 -openupm add com.gsr.tmproplayer@1.1.3 +openupm add com.gsr.tmproplayer@1.1.4 ``` 如果你使用了魔改的 `com.unity.textmeshpro` ,并且无法正确被识别为依赖时,请使用如下命令安装: @@ -71,7 +71,7 @@ openupm add com.gsr.tmproplayer -f 在 Unity 引擎中,打开 `Package Manager` ,点击左上角的 `+` ,选择 `Add package from git URL` ,然后输入本项目的 git 地址即可: ```shell -https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.3 +https://github.com/Giresharu/TMPro-Player.git?path=Assets#1.1.4 ``` 建议使用 git URL 安装时指定版本号,否则会默认更新为最新仓库,而非最新版本。有可能会安装不稳定的仓库。