Exemple #1
0
 void Update()
 {
     if (!playManager.IsMiniGameRunning)
     {
         for (int i = 0; i < TutorialTurnSystem.players.Count; i++)
         {
             if (playManager.PlayerTurnIndex == i)
             {
                 if (!drawnCard)
                 {
                     interactionPanel.SetActive(true);
                     typeCardText.text = "Interaction Cards";
                 }
                 else
                 {
                     if (!finishInteraction)
                     {
                         interactionPanel.SetActive(true);
                         movementPanel.SetActive(false);
                         for (int j = 0; j < MAXCARDS && !interacting; j++)
                         {
                             if (interactionHand[j].GetComponent <NetworkCard>().Selected)
                             {
                                 if (playManager.PlayerMoving ||
                                     playManager.IsMiniGameRunning ||
                                     interactionHand[j].GetComponent <NetworkCard>().Empty)
                                 {
                                     interactionHand[j].GetComponent <NetworkCard>().Selected = false;
                                 }
                                 else
                                 {
                                     //Disable interacting first (Order matters here)
                                     interacting          = true;
                                     cardSelectedPosition = j;
                                     playManager.InteractPlayer(interactionHand[j].GetComponent <NetworkCard>().Index, j);
                                 }
                             }
                         }
                     }
                     else
                     {
                         interactionPanel.SetActive(false);
                         movementPanel.SetActive(true);
                         typeCardText.text = "Movement Cards";
                         for (int j = MAXCARDS - 1; j >= 0; j--)
                         {
                             if (movementHand[j].GetComponent <NetworkCard>().Selected)
                             {
                                 if (playManager.PlayerMoving ||
                                     playManager.IsMiniGameRunning ||
                                     movementHand[j].GetComponent <NetworkCard>().Empty)
                                 {
                                     movementHand[j].GetComponent <NetworkCard>().Selected = false;
                                 }
                                 else
                                 {
                                     playManager.MovePlayer(movementHand[j].GetComponent <NetworkCard>().Index);
                                     movementHand[j].GetComponent <NetworkCard>().SetOriginalImage();
                                     finishInteraction = false;
                                     drawnCard         = false;
                                 }
                             }
                         }
                     }
                 }
             }
             else
             {
                 //Disable the the display of the other players cards
                 interactionPanel.SetActive(false);
                 movementPanel.SetActive(false);
             }
         }
     }
 }