IEnumerator ExecuteRequest(Dictionary <string, string> postData) { www.Send(); float elapsedTime = 0.0f; while (!www.isDone) { elapsedTime += Time.deltaTime; if (elapsedTime >= timeOutLimit) { CloudConnectorCore.ProcessResponse("TIME_OUT", elapsedTime); break; } yield return(null); } if (www.isNetworkError) { CloudConnectorCore.ProcessResponse(CloudConnectorCore.MSG_CONN_ERR + "Connection error after " + elapsedTime.ToString() + " seconds: " + www.error, elapsedTime); yield break; } CloudConnectorCore.ProcessResponse(www.downloadHandler.text, elapsedTime); }
static void EditorUpdate() { while (!www.isDone) { elapsedTime = EditorApplication.timeSinceStartup - startTime; if (elapsedTime >= timeOutLimit) { CloudConnectorCore.ProcessResponse("TIME_OUT", (float)elapsedTime); EditorApplication.update -= EditorUpdate; } return; } if (www.isNetworkError) { CloudConnectorCore.ProcessResponse(CloudConnectorCore.MSG_CONN_ERR + "Connection error after " + elapsedTime.ToString() + " seconds: " + www.error, (float)elapsedTime); return; } CloudConnectorCore.ProcessResponse(www.downloadHandler.text, (float)elapsedTime); EditorApplication.update -= EditorUpdate; }