Пример #1
0
 public void ButtonPressed(int b)
 {
     if (b >= 2 && b <= 5)
     {
         if (owner.localPlayer.team != b - 1)
         {
             team = b - 1;
             owner.localPlayer.SetTeam(b - 1);
             UpdateCircles();
         }
     }
     else if (b == 0) // Start match
     {
         print("Initiating multiplayer match");
         bool[] activeTeams = new bool[4];
         for (int i = 0; i < 4; i++)
         {
             activeTeams[i] = (teamPlayers[i + 1] > 0);
         }
         owner.InitiateMultiplayerMatch(activeTeams);
     }
     else if (b == 1) // Back
     {
         owner.BackButtonPressed();
     }
 }
 public void ButtonPressed(int b)
 {
     if (b >= 1 && b <= 9 && match.secondsLeft > 0) // More checks later
     {
         if (cursorX >= 0 && cursorX < size && cursorY >= 0 && cursorY < size)
         {
             soundH = cursorX;
             soundV = cursorY;
             soundD = b + 10 * myTeam;
             owner.AskToSetDigit(b + 10 * myTeam, cursorX, cursorY);
         }
     }
     else if (b == 0) // Back
     {
         //owner.AskToDisconnect();
         owner.BackButtonPressed();
     }
 }