mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
TEngine全面更新,升级YooAsset2.1.1、UniTask、UIWindow、I2Localization
TEngine全面更新,升级YooAsset2.1.1、UniTask、UIWindow、I2Localization
This commit is contained in:
@@ -6,46 +6,46 @@ using UnityEngine;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal class UnityWebDataRequester : UnityWebRequesterBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送GET请求
|
||||
/// </summary>
|
||||
public void SendRequest(string url, int timeout = 60)
|
||||
{
|
||||
if (_webRequest == null)
|
||||
{
|
||||
URL = url;
|
||||
ResetTimeout(timeout);
|
||||
internal class UnityWebDataRequester : UnityWebRequesterBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 发送GET请求
|
||||
/// </summary>
|
||||
public void SendRequest(string url, int timeout = 60)
|
||||
{
|
||||
if (_webRequest == null)
|
||||
{
|
||||
URL = url;
|
||||
ResetTimeout(timeout);
|
||||
|
||||
_webRequest = DownloadSystem.NewRequest(URL);
|
||||
DownloadHandlerBuffer handler = new DownloadHandlerBuffer();
|
||||
_webRequest.downloadHandler = handler;
|
||||
_webRequest.disposeDownloadHandlerOnDispose = true;
|
||||
_operationHandle = _webRequest.SendWebRequest();
|
||||
}
|
||||
}
|
||||
_webRequest = DownloadHelper.NewRequest(URL);
|
||||
DownloadHandlerBuffer handler = new DownloadHandlerBuffer();
|
||||
_webRequest.downloadHandler = handler;
|
||||
_webRequest.disposeDownloadHandlerOnDispose = true;
|
||||
_operationHandle = _webRequest.SendWebRequest();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下载的字节数据
|
||||
/// </summary>
|
||||
public byte[] GetData()
|
||||
{
|
||||
if (_webRequest != null && IsDone())
|
||||
return _webRequest.downloadHandler.data;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取下载的字节数据
|
||||
/// </summary>
|
||||
public byte[] GetData()
|
||||
{
|
||||
if (_webRequest != null && IsDone())
|
||||
return _webRequest.downloadHandler.data;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下载的文本数据
|
||||
/// </summary>
|
||||
public string GetText()
|
||||
{
|
||||
if (_webRequest != null && IsDone())
|
||||
return _webRequest.downloadHandler.text;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取下载的文本数据
|
||||
/// </summary>
|
||||
public string GetText()
|
||||
{
|
||||
if (_webRequest != null && IsDone())
|
||||
return _webRequest.downloadHandler.text;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user