Example #1
0
    private void PlayerJoinedRoom(PhotonPlayer photonPlayer, int id)
    {
        if (photonPlayer == null)
        {
            return;
        }
        PlayerLeftRoom(photonPlayer);
        GameObject playerListingObject = Instantiate(playerListingPrefab);

        playerListingObject.transform.SetParent(transform, false);
        PlayerListing playerListing = playerListingObject.GetComponent <PlayerListing>();

        playerListing.applyPlayerNumber(id);
        playerListing.ApplyPhotonPlayer(photonPlayer);
        playerListings.Add(playerListing);
    }