D
D
dark_spectator2019-01-23 23:24:47
C++ / C#
dark_spectator, 2019-01-23 23:24:47

Installing image from Unity server?

You need to download the image from the server via a direct link, save it to your phone and set it to the Image element. How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dark_spectator, 2019-01-24
@dark_spectator

Tired of searching.

private IEnumerator GetAvatar()
    {
        string url = "Ссылка на картинку";
        WWW img = new WWW(url);
        yield return img;
        Image imga = avatar.GetComponent<Image>();
        imga.sprite = Sprite.Create((Texture2D)img.texture, new Rect(0, 0, img.texture.width, img.texture.height), Vector2.zero);
    }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question