Esempio n. 1
0
    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();
    }
Esempio n. 2
0
    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!");
        }
    }