AssemblyCSharp.WwwHelper.GetResponse C# (CSharp) Метод

GetResponse() публичный статический Метод

public static GetResponse ( WWW www, CancellationToken cancellationToken, string expectedHash = null, Action reportProgress = null ) : IEnumerator
www UnityEngine.WWW
cancellationToken CancellationToken
expectedHash string
reportProgress Action
Результат IEnumerator
        public static IEnumerator GetResponse(WWW www, CancellationToken cancellationToken, string expectedHash = null, Action<float> reportProgress = null)
        {
            var monitor = new WWWConnectionMonitor(www);
            var progress = 0.0f;

            while (!www.isDone && !cancellationToken.IsCanceled)
            {
            monitor.AssertLiveliness();

            if (reportProgress != null && www.progress != progress)
            {
                progress = www.progress;
                reportProgress(progress);
            }
            yield return null;
            }

            if (reportProgress != null)
            {
            reportProgress(www.progress);
            }

            if (cancellationToken.IsCanceled) yield break;

            if (!string.IsNullOrEmpty(www.error))
            {
            throw new WwwErrorException(www);
            }

            if (expectedHash != null)
            {
            using (var md5 = MD5.Create())
            {
                if (expectedHash != FileHelper.GetFingerprint(md5.ComputeHash(www.bytes)))
                {
                    throw new WwwErrorException(HttpStatusCode.ExpectationFailed);
                }
            }
            }
        }