Пример #1
0
    //[Command]
    //public static void CmdClientReadyToggle(uint connectionID, bool setReady)
    //{

    //    //toggle ready state of a client
    //    if (setReady)
    //        NetworkServer.SetClientReady(NetworkServer.connections[connectionID]);
    //    else
    //        NetworkServer.SetClientNotReady(NetworkServer.connections[connectionID]);
    //}

    public Color FirstAvailablePlayerColor()
    {
        foreach (var color in Colors)
        {
            if (ColorsInUse.Contains(color))
            {
                continue;
            }
            return(color);
        }
        return(Color.white);
    }
Пример #2
0
 public void UpdateAvailableColors(LobbyPlayer player, Color color)
 {
     if (!ColorsInUse.Remove(player.PlayerColor) && player.PlayerColor != Color.white)
     {
         Debug.LogError("Tried to make a color available that was already available." + player.PlayerColor.GetName());
     }
     if (ColorsInUse.Contains(color))
     {
         Debug.LogError("Tried to make an unavailable color unavailable..." + color.GetName());
     }
     else
     {
         ColorsInUse.Add(color);
     }
 }