Ejemplo n.º 1
0
    private void AddPlayerListing(Player player)
    {
        // team
        //if (_listing_Blu.Count >= _listing_Red.Count)
        //{
        //    PlayerListing listing = Instantiate(_playerListing, _content_Red);
        //    if (listing != null)
        //    {
        //        listing.SetPlayerInfo(player, true);
        //        _listing_Red.Add(listing);
        //    }
        //}
        //else
        //{
        //    PlayerListing listing = Instantiate(_playerListing, _content_Blu);
        //    if (listing != null)
        //    {
        //        listing.SetPlayerInfo(player, false);
        //        _listing_Blu.Add(listing);
        //    }
        //}
        // solo
        PlayerListing listing = Instantiate(_playerListing, _content_Red);

        if (listing != null)
        {
            listing.SetPlayerInfo(player, true);
            _listing.Add(listing);
        }
    }
Ejemplo n.º 2
0
    public void AddPlayerListing(Player player)
    {
        int index = _listings.FindIndex(x => x.Player == player);

        if (index != -1)
        {
            _listings[index].SetPlayerInfo(player);
        }
        //if ((byte)player.CustomProperties["Team"] == 1)
        if (player.GetTeam() == PhotonTeams.Team.Red)
        {
            PlayerListing playerListing = Instantiate(_playerListingRedTeam, _contentTeamRed);
            if (playerListing != null)
            {
                playerListing.SetPlayerInfo(player);
                _listings.Add(playerListing);
            }
        }
        else if (player.GetTeam() == PhotonTeams.Team.Blue)
        {
            PlayerListing playerListing = Instantiate(_playerListingBlueTeam, _contentTeamBlue);
            if (playerListing != null)
            {
                playerListing.SetPlayerInfo(player);
                _listings.Add(playerListing);
            }
        }
    }
Ejemplo n.º 3
0
    private void AddPlayerListing(Player player)
    {
        PlayerListing listing = Instantiate(_playerListing, _content);

        if (listing != null)
        {
            listing.SetPlayerInfo(player);
            _listing.Add(listing);
        }
    }
Ejemplo n.º 4
0
    public override void OnPlayerEnteredRoom(Player newPlayer)
    {
        PlayerListing listing = Instantiate(_playerListing, _content);

        if (listing != null)
        {
            listing.SetPlayerInfo(newPlayer);
            _listings.Add(listing);
        }
    }
Ejemplo n.º 5
0
    public override void OnPlayerEnteredRoom(Player newPlayer)
    {
        Debug.Log("Entered room");
        PlayerListing listing = Instantiate(_playerListingPrefab, PlayersContent);

        if (listing != null)
        {
            listing.SetPlayerInfo(newPlayer);
            _playerListings.Add(listing);
        }
    }
    private void AddPlayerListing(Player newPlayer)
    {
        PlayerListing playerInList = Instantiate(_playerListing, SetContentTransform(), Quaternion.identity);

        playerInList.transform.SetParent(_inRoomCanvas.transform, false);
        if (playerInList != null)
        {
            playerInList.SetPlayerInfo(newPlayer);
            _listOfPlayers.Add(playerInList);
        }
    }
Ejemplo n.º 7
0
    // populates list of players and sets their info
    private void AddPlayerListing(Photon.Realtime.Player player)
    {
        // creates listing and adds to list of rooms
        PlayerListing listing = Instantiate(playerListing, content);

        if (listing != null)
        {
            listing.SetPlayerInfo(player);
            listings.Add(listing);
        }
    }
Ejemplo n.º 8
0
 private void GeneratePlayerList()
 {
     foreach (KeyValuePair <int, Player> playerInfo in PhotonNetwork.CurrentRoom.Players)
     {
         PlayerListing listing = Instantiate(_playerListing, _content);
         if (listing != null)
         {
             listing.SetPlayerInfo(playerInfo.Value);
         }
         listings.Add(listing);
     }
 }
    private void AddPlayerListing(Player player)
    {
        //player.NickName = player.NickName;

        PlayerListing listing = Instantiate(_playerListing, _content);

        if (listing != null)
        {
            listing.SetPlayerInfo(player);
        }
        listings.Add(listing);
    }
    private void AddPlayerListing(Player player)
    {
        int index = _listings.FindIndex(x => x.Player == player);

        if (index != -1)
        {
            _listings[index].SetPlayerInfo(player);
        }
        PlayerListing listing = Instantiate(_playerListing, _content);

        if (listing != null)
        {
            listing.SetPlayerInfo(player);
            _listings.Add(listing);
        }
    }
Ejemplo n.º 11
0
    private void AddPlayerListing(Player player)
    {
        int index = listings.FindIndex(x => x.player == player);

        if (index == -1)
        {
            PlayerListing listing = Instantiate(playerListing, content);
            if (listing != null)
            {
                listing.SetPlayerInfo(player);
                listings.Add(listing);
            }
        }
        else
        {
            listings[index].SetPlayerInfo(player);
        }
    }
Ejemplo n.º 12
0
    private void AddPlayerListing(Player player)
    {
        int index = _listing.FindIndex(x => x.Player == player);

        if (index != -1)
        {
            _listing[index].SetPlayerInfo(player);
        }
        else
        {
            PlayerListing listing = (PlayerListing)Instantiate(_playerListPrefab, _content);
            if (listing != null)
            {
                listing.SetPlayerInfo(player);
                _listing.Add(listing);
            }
        }
    }
Ejemplo n.º 13
0
    private void AddPlayerListing(Player player)
    {
        int index = _listings.FindIndex(x => x.Player == player);//x is some element in the _listings list.

        if (index != -1)
        {
            _listings[index].SetPlayerInfo(player);//Just update it if it exists
        }
        else
        {
            PlayerListing listing = Instantiate(_playerListing, _content);
            if (listing != null)
            {
                listing.SetPlayerInfo(player);//Update the text on the Room Listing
                _listings.Add(listing);
            }
        }
    }
Ejemplo n.º 14
0
    private void AddPlayerListing(Player thisPlayer)
    {
        int index = _playerListings.FindIndex(x => x.Player == thisPlayer);

        if (index != -1)
        {
            _playerListings[index].SetPlayerInfo(thisPlayer);
        }
        else
        {
            PlayerListing listing = Instantiate(_playerListingPrefab, PlayersContent);

            if (listing != null)
            {
                listing.SetPlayerInfo(thisPlayer);
                _playerListings.Add(listing);
            }
        }
    }
    private void AddPlayerListing(Player player)
    {
        int index = _listings.FindIndex(x => x.Player == player);

        // If we already had that player listing, update it
        if (index != -1)
        {
            _listings[index].SetPlayerInfo(player);
        }
        // Otherwise, create a new listing
        else
        {
            PlayerListing listing = Instantiate(_playerListing, _content);

            if (listing != null)
            {
                listing.SetPlayerInfo(player);
                _listings.Add(listing);
            }
        }
    }