Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (CrowdVars.CanContinue())
     {
         continueButton.SetActive(true);
     }
 }
Esempio n. 2
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. 3
0
    public void UpdateSliderValue()
    {
        int val = (int)crowdSlider.GetComponent <Slider>().value *increment;

        currentDisplay.GetComponent <Text>().text = val.ToString();
        CrowdVars.SetCrowdSize(val);
    }
Esempio n. 4
0
 public void OnContinueClicked()
 {
     if (CrowdVars.CanContinue())
     {
         StartCoroutine(Upload());
         SceneManager.LoadScene(nextScene);
     }
 }
Esempio n. 5
0
    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);
        }
    }
Esempio n. 7
0
 // Use this for initialization
 void Start()
 {
     Debug.Log(CrowdVars.GetCaptainPosition());
     Debug.Log(CrowdVars.GetCrowdSize());
     Debug.Log(CrowdVars.GetMood());
 }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     prestonPosition = (int)CrowdVars.GetCaptainPosition();
     CaptainSpawn();
     //TownpersonSpawn ();
 }
Esempio n. 9
0
 // Use this for initialization
 void Start()
 {
     numPeople = CrowdVars.GetCrowdSize();
     TownpersonSpawn();
 }
Esempio n. 10
0
 private void Start()
 {
     crowdMood = (int)CrowdVars.GetMood();
     trans     = this.GetComponent <Transform>();
 }