Пример #1
0
        public static void QueueForDownload(ILootLockerScreenShotOwner previewOwner)
        {
            if (string.IsNullOrEmpty(previewOwner?.url))
            {
                return;
            }
            if (Instance.downloadedTextures.Contains(previewOwner.url))
            {
                previewOwner.SaveTexture(Instance.downloadedTextures.GetTextureSaveClass(previewOwner.url)?.sprite);
                return;
            }

            if (!previewOwner.url.Contains("http"))
            {
                return;
            }

            if (!previewImageDownloadQueue.Contains(previewOwner))
            {
                previewImageDownloadQueue.Add(previewOwner);
                if (ImageDownloadThread1 == null)
                {
                    ImageDownloadThread1 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread2 == null)
                {
                    ImageDownloadThread2 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread3 == null)
                {
                    ImageDownloadThread3 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread4 == null)
                {
                    ImageDownloadThread4 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread5 == null)
                {
                    ImageDownloadThread5 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread6 == null)
                {
                    ImageDownloadThread6 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread7 == null)
                {
                    ImageDownloadThread7 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread8 == null)
                {
                    ImageDownloadThread8 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
                if (ImageDownloadThread9 == null)
                {
                    ImageDownloadThread9 = Instance.StartCoroutine(DownloadPreviewImagesAsync());
                }
            }
        }
Пример #2
0
        public TextureSaveClass GetTextureSaveClass(ILootLockerScreenShotOwner url)
        {
            TextureSaveClass textureSaveClass = textureSaveClasses.FirstOrDefault(x => x.owner == url);

            if (textureSaveClass != null)
            {
                return(textureSaveClass);
            }
            return(null);
        }
Пример #3
0
        public bool Contains(ILootLockerScreenShotOwner url)
        {
            TextureSaveClass textureSaveClass = textureSaveClasses.FirstOrDefault(x => x.owner == url);

            if (textureSaveClass != null)
            {
                return(true);
            }
            return(false);
        }
Пример #4
0
        public void Remove(ILootLockerScreenShotOwner url)
        {
            TextureSaveClass[] textureSaveClass = textureSaveClasses.Where(x => x.owner == url).ToArray();

            if (textureSaveClass != null)
            {
                for (int i = 0; i < textureSaveClass.Length; i++)
                {
                    if (textureSaveClasses.Contains(textureSaveClasses[i]))
                    {
                        textureSaveClasses.Remove(textureSaveClass[i]);
                    }
                }
            }
        }