Esempio n. 1
0
    public void OnDownloadComplete(Texture2D texture, string subDirectory, MaskableGraphic graphic)
    {
        if (graphic.GetType().Name == "RawImage")
        {
            SetRawImageThumbnailObject(graphic as RawImage, texture);
        }
        if (graphic.GetType().Name == "Image")
        {
            SetImageThumbnailObject(graphic as Image, texture);
        }

        SaveThumbnail(subDirectory, texture.EncodeToPNG());
    }
Esempio n. 2
0
    public void LoadThumbnail(string subDirectory, MaskableGraphic thumbnail)
    {
        Texture2D texture = LoadImage(subDirectory);

        if (texture != null)
        {
            if (thumbnail.GetType().Name == "RawImage")
            {
                SetRawImageThumbnailObject(thumbnail as RawImage, texture);
            }
            if (thumbnail.GetType().Name == "Image")
            {
                SetImageThumbnailObject(thumbnail as Image, texture);
            }
        }
    }