private void init(BGIRequestResult requestResult, float inHttpTimeOut, RequestType inType) { requestBody = requestResult; type = inType; httpTimeOut = inHttpTimeOut; requestSuccessed = requestResult.requestSuccessed; requestSuccessedTexture = requestResult.requestSuccessedTexture; requestFail = requestResult.requestFail; }
public void dispose() { if (client != null) { client.Dispose(); } resultarr = null; client = null; idle = true; requestBody = null; requestFail = null; requestSuccessedTexture = null; requestSuccessed = null; }
public IEnumerator SendRequestEnumerator(UnityWebRequest request, RequestSuccess onSuccess = null, RequestFail onFail = null) { using (UnityWebRequest webRequest = request) { yield return(webRequest.SendWebRequest()); Logger.LogResponse(webRequest); string text = webRequest.downloadHandler.text; Logger.Verbose(text); if (webRequest.IsOk()) { onSuccess?.Invoke(text); } else { onFail?.Invoke(text); } } }
public void SendRequest(UnityWebRequest request, RequestSuccess onSuccess = null, RequestFail onFail = null) { runner.StartCoroutine(SendRequestEnumerator(request, onSuccess, onFail)); }