From 89231a48d8b3f07d85deb32f0dec18d16d43f61f Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 23 Dec 2024 12:02:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dweb=E5=B9=B3=E5=8F=B0txt?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=96=87=E4=BB=B6=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scripts/LocalTextSupport/LocalTextSupport.cs | 13 ++----------- Assets/Scripts/Actions/LoadResAction.cs | 2 +- Assets/Scripts/Launch.cs | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Assets/QFramework/Toolkits/ResKit/Scripts/LocalTextSupport/LocalTextSupport.cs b/Assets/QFramework/Toolkits/ResKit/Scripts/LocalTextSupport/LocalTextSupport.cs index 52f1e4ed..9ec59aec 100644 --- a/Assets/QFramework/Toolkits/ResKit/Scripts/LocalTextSupport/LocalTextSupport.cs +++ b/Assets/QFramework/Toolkits/ResKit/Scripts/LocalTextSupport/LocalTextSupport.cs @@ -22,7 +22,7 @@ namespace QFramework private string mFullPath; private string mHashCode; private object mRawAsset; - + public string text; UnityWebRequest request; public static LocalTextRes Allocate(string name) { @@ -181,7 +181,7 @@ namespace QFramework else { // Convert the downloaded data to an AudioClip - mAsset = new StringAsset(request.downloadHandler.text); + text = request.downloadHandler.text; } if (RefCount <= 0) @@ -267,12 +267,3 @@ namespace QFramework */ } } -public class StringAsset : ScriptableObject -{ - public string text; - public StringAsset(string text) - { - this.text = text; - } - -} \ No newline at end of file diff --git a/Assets/Scripts/Actions/LoadResAction.cs b/Assets/Scripts/Actions/LoadResAction.cs index cb6df41a..ceaa950e 100644 --- a/Assets/Scripts/Actions/LoadResAction.cs +++ b/Assets/Scripts/Actions/LoadResAction.cs @@ -48,7 +48,7 @@ namespace QFramework { if (success) { - string xmlStr = res.Asset.As().text; + string xmlStr = res.As().text; if (string.IsNullOrEmpty(xmlStr) == false) { // XML diff --git a/Assets/Scripts/Launch.cs b/Assets/Scripts/Launch.cs index 26bdd4d2..2a13b1b4 100644 --- a/Assets/Scripts/Launch.cs +++ b/Assets/Scripts/Launch.cs @@ -23,7 +23,7 @@ public class Launch : MonoBehaviour { if (success) { - Global.Instance.appData = XmlParser.ParseXml(res.Asset.As().text); + Global.Instance.appData = XmlParser.ParseXml(res.As().text); } });