//Wating for a request IEnumerator WaitForRequest(WWW URLConnection, WWWForm FaceForm) { yield return new WaitForSeconds (5); yield return URLConnection; yield return FaceForm; //Exception to control the web service connection if(URLConnection.error == null) { Debug.Log (URLConnection.text); Debug.Log ("The Connection would be in a few seconds…" + URLConnection.progress); Debug.Log ("Succesful Connection"); //Flags for watch the expected beahavior jSonReader = new JSonReader (URLConnection.text); Debug.Log ("Tengo esto: " + jSonReader.jsonString); Debug.Log ("Triste es igual a… " + jSonReader.EmotionVal1); Debug.Log ("Neutral es igual a… " + jSonReader.EmotionVal2); Debug.Log ("Enojado es igual a… " + jSonReader.EmotionVal3); Debug.Log ("Sorprendido es igual a… " + jSonReader.EmotionVal4); Debug.Log ("Miedo es igual a… " + jSonReader.EmotionVal5); Debug.Log ("Felicidad es igual a… " + jSonReader.EmotionVal6); //Getting the conclusion and setting the mood Mood = jSonReader.GetMoodConclusion(); setMood(Mood); //Sending the mood to the invoker storyTellerInvoker.GetComponent<StoryTellerInvoker>().setMood(Mood); //The powerful trafficlights TrafficLights.stopAndPlay = 0; TrafficLights.stopCommand = 0; Debug.Log ("la variable de storyTellerInvoker tiene: " + storyTellerInvoker.GetComponent<StoryTellerInvoker>().getMood()); } else { //Message error: When the Web service couldn't connect Debug.Log("Whoops!!! There was a little problem: " + URLConnection.error); } //Reading photos CounterSnaps++; string currentURL = PhotoLocation + CounterSnaps + ".jpg"; MakeFaceRequest (currentURL); }