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