void Start () {
StartCoroutine(SetAvatar());
}
IEnumerator SetAvatar()
{
while (true)
{
if (avatarLoaded == false && PlayerObjectScript.display_pic != "")
{
Texture2D ava
= new Texture2D
(50,
50, TextureFormat
.DXT1,
false);; var www
= new WWW
(PlayerObjectScript
.display_pic); www.LoadImageIntoTexture(ava);
this.GetComponent<UITexture>().mainTexture = ava;
avatarLoaded = true;
}
else
{
yield return null;
}
}
}