示例#1
0
    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));
                }
            }
        }
    }
示例#2
0
 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);
     }
 }
示例#3
0
 void Start()
 {
     StartCoroutine(display());
     FinalPanel.SetActive(false);
 }