Exemplo n.º 1
0
 public bool CheckValidColorIndex(PlayerColorChooser checking)
 {
     foreach (PlayerColorChooser pc in ColorChoosers)
     {
         if (pc == checking)
         {
             continue;
         }
         if (pc.ColorIndex == checking.ColorIndex)
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 2
0
    public void ColorLeft(int playerIndex)
    {
        PlayerColorChooser pc = ColorChoosers[playerIndex];

        if (pc.ColorIndex > 0)
        {
            pc.ColorIndex--;
        }
        else
        {
            pc.ColorIndex = (PlayerColors.Count - 1);
        }

        if (!CheckValidColorIndex(pc))
        {
            ColorLeft(playerIndex);
        }

        //Set the players color according to the index
        pc.playerColor.color = PlayerColors[pc.ColorIndex];
    }