// Update is called once per frame void Update() { if (CrowdVars.CanContinue()) { continueButton.SetActive(true); } }
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!"); } } }
public void UpdateSliderValue() { int val = (int)crowdSlider.GetComponent <Slider>().value *increment; currentDisplay.GetComponent <Text>().text = val.ToString(); CrowdVars.SetCrowdSize(val); }
public void OnContinueClicked() { if (CrowdVars.CanContinue()) { StartCoroutine(Upload()); SceneManager.LoadScene(nextScene); } }
public void OnHostileClicked() { if (!hostileClicked) { hostileClicked = true; calmClicked = false; agitatedClicked = false; hostileButton.GetComponent <Image> ().color = Color.white; if (lastClicked != null) { lastClicked.GetComponent <Image> ().color = regularColor; } lastClicked = hostileButton; CrowdVars.SetMood(CrowdVars.MOOD.Hostile); } }
public void OnRightClicked() { if (!rightClicked) { rightClicked = true; frontClicked = false; behindClicked = false; leftClicked = false; rightButton.GetComponent <Image> ().color = Color.white; if (lastClicked != null) { lastClicked.GetComponent <Image> ().color = regularColor; } lastClicked = rightButton; CrowdVars.SetCaptainPosition(CrowdVars.POSITION.Right); } }
// Use this for initialization void Start() { Debug.Log(CrowdVars.GetCaptainPosition()); Debug.Log(CrowdVars.GetCrowdSize()); Debug.Log(CrowdVars.GetMood()); }
// Use this for initialization void Start() { prestonPosition = (int)CrowdVars.GetCaptainPosition(); CaptainSpawn(); //TownpersonSpawn (); }
// Use this for initialization void Start() { numPeople = CrowdVars.GetCrowdSize(); TownpersonSpawn(); }
private void Start() { crowdMood = (int)CrowdVars.GetMood(); trans = this.GetComponent <Transform>(); }