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()); }
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); } } }