修复web平台txt类型的文件加载bug
This commit is contained in:
parent
f070adfade
commit
89231a48d8
@ -22,7 +22,7 @@ namespace QFramework
|
|||||||
private string mFullPath;
|
private string mFullPath;
|
||||||
private string mHashCode;
|
private string mHashCode;
|
||||||
private object mRawAsset;
|
private object mRawAsset;
|
||||||
|
public string text;
|
||||||
UnityWebRequest request;
|
UnityWebRequest request;
|
||||||
public static LocalTextRes Allocate(string name)
|
public static LocalTextRes Allocate(string name)
|
||||||
{
|
{
|
||||||
@ -181,7 +181,7 @@ namespace QFramework
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Convert the downloaded data to an AudioClip
|
// Convert the downloaded data to an AudioClip
|
||||||
mAsset = new StringAsset(request.downloadHandler.text);
|
text = request.downloadHandler.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RefCount <= 0)
|
if (RefCount <= 0)
|
||||||
@ -267,12 +267,3 @@ namespace QFramework
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public class StringAsset : ScriptableObject
|
|
||||||
{
|
|
||||||
public string text;
|
|
||||||
public StringAsset(string text)
|
|
||||||
{
|
|
||||||
this.text = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -48,7 +48,7 @@ namespace QFramework
|
|||||||
{
|
{
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
string xmlStr = res.Asset.As<StringAsset>().text;
|
string xmlStr = res.As<LocalTextRes>().text;
|
||||||
if (string.IsNullOrEmpty(xmlStr) == false)
|
if (string.IsNullOrEmpty(xmlStr) == false)
|
||||||
{
|
{
|
||||||
// ¼ÓÔØXML
|
// ¼ÓÔØXML
|
||||||
|
|||||||
@ -23,7 +23,7 @@ public class Launch : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
Global.Instance.appData = XmlParser.ParseXml(res.Asset.As<StringAsset>().text);
|
Global.Instance.appData = XmlParser.ParseXml(res.As<LocalTextRes>().text);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user