Description
using UnityEngine;
using Volplane;
public class Demo : VolplaneBehaviour
{
private VPlayer p;
private bool pictureLoaded = false;
void OnConnect(VPlayer player)
{
if(p == null)
{
// Start loading profile picture
StartCoroutine(player.LoadProfilePicture());
// Store reference to player object
p = player;
}
}
void OnGUI()
{
if(pictureLoaded == false)
{
// Player connected and loaded profile picture
if((p != null) && (p.ProfilePicture != null))
{
pictureLoaded = true;
// Display profile picture
GUI.DrawTexture(
new Rect(10f, 10f, 256f, 256f),
p.ProfilePicture,
ScaleMode.ScaleToFit
);
}
}
}
}
Gets the players profile picture. Make sure you have previously loaded the profile picture with LoadProfilePicture().