public void RpcChangePhase(TurnPhase turnPhase, string player) { TurnPhase = turnPhase; TurnStartPlayer = player; if (TurnPhase == TurnPhase.Initial) { ConceptInput.text = ""; ConceptInput.interactable = AcceptButton.interactable = Player.Instance.Name == TurnStartPlayer; Player.Instance.Status = Player.Instance.Name == TurnStartPlayer ? PlayerStatus.Playing : PlayerStatus.Waiting; WaitingPanel.SetActive(Player.Instance.Status == PlayerStatus.Waiting); if (Player.Instance.Name != TurnStartPlayer) { Player.Instance.NextTurn(); } FinalPanel.SetActive(false); MainPanel.SetActive(true); } else if (TurnPhase == TurnPhase.Middle) { ClearToggles(); ConceptInput.interactable = false; AcceptButton.interactable = Player.Instance.Name != TurnStartPlayer; Player.Instance.Status = Player.Instance.Name != TurnStartPlayer ? PlayerStatus.Playing : PlayerStatus.Waiting; WaitingPanel.SetActive(Player.Instance.Status == PlayerStatus.Waiting); if (Player.Instance.Name == TurnStartPlayer) { Player.Instance.NextTurn(); } FinalPanel.SetActive(false); MainPanel.SetActive(true); } else if (TurnPhase == TurnPhase.Final) { ClearToggles(); ConceptInput.interactable = false; AcceptButton.interactable = Player.Instance.Name != TurnStartPlayer; Player.Instance.Status = Player.Instance.Name != TurnStartPlayer ? PlayerStatus.Playing : PlayerStatus.Waiting; WaitingPanel.SetActive(Player.Instance.Status == PlayerStatus.Waiting); if (Player.Instance.Name == TurnStartPlayer) { Player.Instance.NextTurn(); } if (Player.Instance.Name != TurnStartPlayer) { MainPanel.SetActive(false); FinalPanel.SetActive(true); foreach (string image in ImageSelections) { AddImage(ClientSocket.RequestImage(image)); } } } }
public void increaseindex() { if (index < question.Count - 1) { index++; questionobject.text = ""; for (int i = 0; i < question[index].answers.Length; i++) { answers[i].text = ""; } StartCoroutine(display()); } else { questionobject.text = ""; for (int i = 0; i < question[index].answers.Length; i++) { answers[i].text = ""; } FinalPanel.SetActive(true); } }
void Start() { StartCoroutine(display()); FinalPanel.SetActive(false); }