private IEnumerator Post(string word, Vector3 pos) { WWWForm form = new WWWForm(); form.AddField("word", word); UnityWebRequest request = UnityWebRequest.Post(URL, form); // リクエスト送信 yield return(request.Send()); if (request.isNetworkError) { Debug.Log("Error:" + request.error); } else { if (request.responseCode == 200) { // Get Data from Python Server string w = request.downloadHandler.text; Debug.Log(w); char[] removeChars = new char[] { '[', ']', '"', ' ' }; foreach (char c in removeChars) { w = w.Replace(c.ToString(), ""); } resultList = w.Split(','); for (int i = 0; i < 10; i++) { Debug.Log(resultList [i]); } bubbleController.DefineWord(resultList, pos); Debug.Log("Success :D"); } else { Debug.Log("Failed ;( :" + request.responseCode); } } }
public void InputLogger() { bubbleController.DefineWord(inputField.text); }
void GenerateRelatedBubbles() { bubbleController.DefineWord(textMesh.text, transform.position); Destroy(gameObject); }