LoadProfilePicture

public IEnumerator LoadProfilePicture(int size = 256);

Description


using UnityEngine;
using Volplane;

public class Demo : VolplaneBehaviour
{
    private VPlayer p;

    void OnConnect(VPlayer player)
    {
        if(p == null)
        {
            // Start loading profile picture
            StartCoroutine(player.LoadProfilePicture());

            // Store reference to player object
            p = player;
        }
    }

    void OnGUI()
    {
        // Player connected and loaded profile picture
        if((p != null) && (p.ProfilePicture != null))
        {
            // Display profile picture
            GUI.DrawTexture(
                new Rect(10f, 10f, 256f, 256f),
                p.ProfilePicture,
                ScaleMode.ScaleToFit
            );
        }
    }
}

Loads the profile picture of this player with a specified size (image ratio 1:1). This method must be used as a Unity coroutine.

 

size The image size in pixel (width and height).