com.alicizax.unity.cysharp..../Runtime/Internal/UnityWebRequestExtensions.cs
陈思海 0f01d0a681
Some checks are pending
Sync Github To Image / sync-gitlink (push) Waiting to run
Sync Github To Image / sync-gitlab (push) Waiting to run
Sync Github To Image / sync-gitee (push) Waiting to run
Sync Github To Image / sync-atomgit (push) Waiting to run
Sync Github To Image / sync-gitcode (push) Waiting to run
Sync Github To Image / sync-framagit (push) Waiting to run
init
2025-01-09 11:14:16 +08:00

28 lines
840 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine.Networking;
namespace Cysharp.Threading.Tasks.Internal
{
#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT)
internal static class UnityWebRequestResultExtensions
{
public static bool IsError(this UnityWebRequest unityWebRequest)
{
#if UNITY_2020_2_OR_NEWER
var result = unityWebRequest.result;
return (result == UnityWebRequest.Result.ConnectionError)
|| (result == UnityWebRequest.Result.DataProcessingError)
|| (result == UnityWebRequest.Result.ProtocolError);
#else
return unityWebRequest.isHttpError || unityWebRequest.isNetworkError;
#endif
}
}
#endif
}