修复XCharts本地开启TextMeshProNewInputSystem后更新版本会报错的问题 (#272)

This commit is contained in:
monitor1394
2023-08-14 21:57:17 +08:00
parent 71c8bc1499
commit 0c187b6ff9
9 changed files with 109 additions and 32 deletions

View File

@@ -273,7 +273,7 @@ namespace XCharts.Runtime
chartText = new ChartText();
#if dUI_TextMeshPro
RemoveComponent<Text>(txtObj);
chartText.tmpText = GetOrAddComponent<TextMeshProUGUI>(txtObj);
chartText.tmpText = EnsureComponent<TextMeshProUGUI>(txtObj);
chartText.tmpText.font = textStyle.tmpFont == null ? theme.tmpFont : textStyle.tmpFont;
chartText.tmpText.fontStyle = textStyle.tmpFontStyle;
chartText.tmpText.richText = true;

View File

@@ -1,6 +1,9 @@
{
"name": "XCharts.Runtime",
"references": [],
"references": [
"Unity.TextMeshPro",
"Unity.InputSystem"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,