public void SetAttributesScore(CollectionPonts ponts) { myTeam.attribute1.score = ponts.atributo1; myTeam.attribute2.score = ponts.atributo2; myTeam.attribute3.score = ponts.atributo3; myTeam.attribute4.score = ponts.atributo4; myTeam.attribute5.score = ponts.atributo5; OnChange(); }
IEnumerator Upload(Dictionary <string, string> data) { //WWWForm form = new WWWForm(); UnityWebRequest www = UnityWebRequest.Post(baseUrl + urlPostPontos, data); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { //Debug.Log(":\nReceived: " + www.downloadHandler.text); CollectionPonts pontos = Mapper.MapCreate <CollectionPonts>(www.downloadHandler.text, new CollectionPonts()); TeamsController.Instance.SetAttributesScore(pontos); //Debug.Log(":\nReceived: " + www.downloadHandler.text); Debug.Log("Form upload complete!"); } }