Esempio n. 1
0
    private void init(BGIRequestResult requestResult, float inHttpTimeOut, RequestType inType)
    {
        requestBody             = requestResult;
        type                    = inType;
        httpTimeOut             = inHttpTimeOut;
        requestSuccessed        = requestResult.requestSuccessed;
        requestSuccessedTexture = requestResult.requestSuccessedTexture;

        requestFail = requestResult.requestFail;
    }
Esempio n. 2
0
 public void dispose()
 {
     if (client != null)
     {
         client.Dispose();
     }
     resultarr               = null;
     client                  = null;
     idle                    = true;
     requestBody             = null;
     requestFail             = null;
     requestSuccessedTexture = null;
     requestSuccessed        = null;
 }
Esempio n. 3
0
        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);
                }
            }
        }
Esempio n. 4
0
 public void SendRequest(UnityWebRequest request, RequestSuccess onSuccess = null, RequestFail onFail = null)
 {
     runner.StartCoroutine(SendRequestEnumerator(request, onSuccess, onFail));
 }