Пример #1
0
        public void OverwriteDownloadUrl(ThumbnailUrl loadThumbnailUrl)
        {
            if (string.IsNullOrEmpty(loadThumbnailUrl.Url))
            {
                return;
            }

            if (imageTex != null && currentTexturePath == loadThumbnailUrl.Url)
            {
                return;
            }

            var downloadThumbnailService = new DownloadThumbnailService(
                loadThumbnailUrl,
                tex =>
            {
                loadingImage = false;
                imageTex     = tex;
            });

            downloadThumbnailService.Run();
            loadingImage       = true;
            imageTex           = Texture2D.whiteTexture;
            currentTexturePath = loadThumbnailUrl.Url;
        }
        public void SetImageUrl(ThumbnailUrl url)
        {
            if (string.IsNullOrEmpty(url.Url))
            {
                SetError();
                return;
            }

            var downloadThumbnailService = new DownloadThumbnailService(
                url, SetSuccess, exc => SetError());

            downloadThumbnailService.Run();
            reactiveOverlay.Val = "…";
        }
Пример #3
0
        public void SetImageUrl(ThumbnailUrl url)
        {
            IsEmpty = string.IsNullOrEmpty(url.Url);
            if (IsEmpty)
            {
                reactiveImageTex.Val = AssetDatabase.LoadAssetAtPath <Texture2D>("Packages/mu.cluster.cluster-creator-kit/Editor/Texture/require_image.png");
                reactiveOverlay.Val  = "";
                return;
            }

            var downloadThumbnailService = new DownloadThumbnailService(
                url, SetSuccess, exc => SetError());

            downloadThumbnailService.Run();

            reactiveOverlay.Val = "…";
        }
Пример #4
0
        public void SetImageUrl(ThumbnailUrl url)
        {
            IsEmpty = string.IsNullOrEmpty(url.Url);
            if (IsEmpty)
            {
                reactiveImageTex.Val = Resources.Load <Texture2D>("require_image");
                reactiveOverlay.Val  = "";
                return;
            }

            var downloadThumbnailService = new DownloadThumbnailService(
                url, SetSuccess, exc => SetError());

            downloadThumbnailService.Run();

            reactiveOverlay.Val = "…";
        }