コード例 #1
0
 public void UpdatePlayer(GameLobbyPlayerData player)
 {
     playerData             = player;
     playerNameText.text    = playerData.Name;
     playerReadyToggle.isOn = playerData.Ready;
     backgroundImage.color  = Id == ColyseusConnector.Instance.Client.id ? OwnClientColor : NormalColor;
     ownerImage.enabled     = player.Owner;
 }
コード例 #2
0
    void UpdatePlayer(GameLobbyPlayerData playerData)
    {
        var listing = playerListings.FirstOrDefault(l => l.Id == playerData.Id);

        if (listing == null)
        {
            listing = CreateNewListing();
        }
        listing.UpdatePlayer(playerData);
    }
コード例 #3
0
    public static GameLobbyPlayerData ReadPlayer(object playerEntry, string ownerId)
    {
        var player     = ReadObject(playerEntry);
        var id         = player["id"] as string;
        var playerData = new GameLobbyPlayerData
        {
            Id    = id,
            Name  = player["name"] as string,
            Ready = player["ready"] as bool? == true,
            Owner = id == ownerId,
        };

        return(playerData);
    }