private IEnumerator _WWWLoadBytesAsync(string path, int timeout, UIEventListener.CallbackBytes cb) { byte[] bytes = null; using (UnityWebRequest www = UnityWebRequest.Get(path)) { www.timeout = timeout; yield return(www.Send()); while (!www.isDone && string.IsNullOrEmpty(www.error)) { yield return(null); } if (www.isError) { Debugger.LogError(www.error); } else { bytes = www.downloadHandler.data; } } if (cb != null) { cb(bytes); } }
private void WWWLoadBytesAsync(string path, int timeout, UIEventListener.CallbackBytes cb) { ioo.GameManager.StartCoroutine(_WWWLoadBytesAsync(path, timeout, cb)); }