/****************************************** * * public void Update() * If the game is in the correct state, waits for the input of each player, * and gets their answer for the BFGI questionnaire. * * Parameters * * Return * * ***************************************/ public void Update() { if (GameManagerScript.GetInstance().currentStage == GameManagerScript.GameStage.BFGI) { foreach (Player p in players) { if (Input.GetButtonDown("Player" + p.playerID + "_X")) { GameObject msg = UIManagerScript.GetInstance().CheckMsg(p.playerObj); if (msg != null) { SituacaoScript script = msg.GetComponent <SituacaoScript>(); if (script != null) { p.answers.Add(script.value); p.ready = true; UIManagerScript.GetInstance().StopDisplayOnScreen(p.playerObj); p.playerObj.SetActive(false); LoadSituation(p.currentStage + 1); } } } } } }
// Update is called once per frame void Update() { if (GameManagerScript.GetInstance().currentStage == GameManagerScript.GameStage.PlayerType) { foreach (Player p in players) { if (Input.GetButtonDown("Player" + p.playerID + "_X")) { GameObject msg = UIManagerScript.GetInstance().CheckMsg(p.playerObj); if (msg != null) { SituacaoScript script = msg.GetComponent <SituacaoScript>(); if (script != null) { switch (curSituationID) { case 0: p.agression = script.value; break; case 1: p.rescuer = script.value; break; case 2: p.greed = script.value; break; } p.ready = true; UIManagerScript.GetInstance().StopDisplayOnScreen(p.playerObj); p.playerObj.SetActive(false); LoadSituation(p.currentStage + 1); } } } } } }