public void RpcEsitoAccusa(string[] accusa, bool esito) { OperativaInterfaccia oi = GameObject.Find("GameManager").GetComponent <OperativaInterfaccia>(); oi.messaggioUI.text = "Accuso " + accusa [0] + " con " + accusa [1] + " in " + accusa [2]; if (esito) { if (oi.IsMyTurn()) { oi.messaggioUI.text = "hai vinto"; } else { oi.messaggioUI.text += ": <b>" + character + " ha vinto!</b>"; } //fine partita GameObject.Find("GameManager").GetComponent <OperativaInterfaccia> ().fineGiocoPanel.SetActive(true); } else { // messaggio accusa sbagliata if (oi.IsMyTurn()) { oi.messaggioUI.text = "Accusa errata, perdi due turni! "; turniDaSaltare = 2; //GameObject.Find ("GameManager").GetComponent<OperativaInterfaccia> ().fineTurno (); } else { oi.messaggioUI.text += ": " + "<b>Sbagliato!</b>"; } } }
public void RpcIpotesi(string[] ipotesi) { OperativaInterfaccia oi = GameObject.Find("GameManager").GetComponent <OperativaInterfaccia>(); oi.messaggioUI.text = "Secondo me è stato " + ipotesi[0] + " con " + ipotesi[1] + " in " + ipotesi[2]; oi.ShowMessaggiPanel(); GameObject.Find("PanelMessaggi").GetComponent <MessageDealer> ().resetMessagePanel(); Pathfinding pf = aStar.GetComponent <Pathfinding>(); GamePlayer myPlayer = pf.seeker.GetComponent <GamePlayer>(); if (!oi.IsMyTurn() && myPlayer.character.Equals(ipotesi[0])) { Room room = pf.grid.FindRoomByName(ipotesi[2]); if (room != null) { if (pf.MoveAfterHypothesis(room)) { oi.movedAfterHypothesis = true; } } else { Debug.Log("errore: stanza non trovata"); } } }
void Update() { if (dado1.value > 0 && dado2.value > 0) { if (oi.IsMyTurn()) { int val = dado1.value + dado2.value; dado1.value = 0; dado2.value = 0; FindTargets(seeker.position, val); changeView.ActivePlayerView(); //Setto invisibili i dadi e collider dado1.gameObject.SetActive(false); dado2.gameObject.SetActive(false); colliderr.gameObject.SetActive(false); seeker.GetComponent <GamePlayer>().CmdAzzeraDadi(dado1.gameObject, dado2.gameObject); } } else if (UnityEngine.Networking.NetworkServer.active && (dado1.value < 0 || dado2.value < 0)) { if (dado1.value < 0) { dado1.RollTheDice(); } if (dado2.value < 0) { dado2.RollTheDice(); } } }