Esempio n. 1
0
        public static void CreateRequest(Dictionary <string, string> form)
        {
#if UNITY_EDITOR
            form.Add("ssid", spreadsheetId);
            form.Add("pass", servicePassword);

            UnityEditor.EditorApplication.update += EditorUpdate;
            if (usePOST)
            {
                CloudConnectorCore.UpdateStatus("Establishing Connection at URL " + webServiceUrl);
                www = UnityWebRequest.Post(webServiceUrl, form);
            }
            else // Use GET.
            {
                string urlParams = "?";
                foreach (KeyValuePair <string, string> item in form)
                {
                    urlParams += item.Key + "=" + item.Value + "&";
                }

                CloudConnectorCore.UpdateStatus("Establishing Connection at URL " + webServiceUrl + urlParams);
                www = UnityWebRequest.Get(webServiceUrl + urlParams);
            }

            startTime = UnityEditor.EditorApplication.timeSinceStartup;
            www.SendWebRequest();
#endif
        }
Esempio n. 2
0
        public void CreateRequest(Dictionary <string, string> form)
        {
            form.Add("ssid", spreadsheetId);
            form.Add("pass", servicePassword);

            if (usePOST)
            {
                CloudConnectorCore.UpdateStatus("Establishing Connection at URL " + webServiceUrl);
                www = UnityWebRequest.Post(webServiceUrl, form);
            }
            else // Use GET.
            {
                string urlParams = "?";
                foreach (KeyValuePair <string, string> item in form)
                {
                    urlParams += item.Key + "=" + item.Value + "&";
                }

                CloudConnectorCore.UpdateStatus("Establishing Connection at URL " + webServiceUrl + urlParams);
                www = UnityWebRequest.Get(webServiceUrl + urlParams);
            }

            StartCoroutine(ExecuteRequest(form));
        }