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 OnEnable() { oi = GameObject.Find("GameManager").GetComponent <OperativaInterfaccia>(); }