예제 #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!");
            }
        }
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     Debug.Log(CrowdVars.GetCaptainPosition());
     Debug.Log(CrowdVars.GetCrowdSize());
     Debug.Log(CrowdVars.GetMood());
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     numPeople = CrowdVars.GetCrowdSize();
     TownpersonSpawn();
 }