Esempio n. 1
0
    IEnumerator Upload()
    {
        int     mood            = (int)CrowdVars.GetMood();
        int     crowdSize       = CrowdVars.GetCrowdSize();
        int     captainPosition = (int)CrowdVars.GetCaptainPosition();
        WWWForm form            = new WWWForm();

        form.AddField("mood", mood);
        form.AddField("crowdSize", crowdSize);
        form.AddField("captainPosition", captainPosition);

        using (UnityWebRequest www = UnityWebRequest.Post(dbURL, form))
        {
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
            }
            else
            {
                Debug.Log("Form upload complete!");
            }
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     Debug.Log(CrowdVars.GetCaptainPosition());
     Debug.Log(CrowdVars.GetCrowdSize());
     Debug.Log(CrowdVars.GetMood());
 }
Esempio n. 3
0
 private void Start()
 {
     crowdMood = (int)CrowdVars.GetMood();
     trans     = this.GetComponent <Transform>();
 }