Exemplo n.º 1
0
        internal void SetThumbnail(string thumbnailURL)
        {
            if (thumbnailURL == currentThumbnail)
            {
                animator.SetTrigger(LOADED_ANIM_TRIGGER);
                return;
            }

            currentThumbnail = thumbnailURL;
            if (thumbnailPromise != null)
            {
                thumbnailPromise.ClearEvents();
                AssetPromiseKeeper_Texture.i.Forget(thumbnailPromise);
            }

            if (string.IsNullOrEmpty(currentThumbnail))
            {
                thumbnailImage.gameObject.SetActive(false);
                animator.SetTrigger(LOADED_ANIM_TRIGGER);
                return;
            }

            thumbnailPromise = new AssetPromise_Texture(currentThumbnail);
            thumbnailPromise.OnSuccessEvent += OnThumbnailReady;
            thumbnailPromise.OnFailEvent    += x =>
            {
                thumbnailImage.gameObject.SetActive(false);
                animator.SetTrigger(LOADED_ANIM_TRIGGER);
                Debug.LogError($"Error downloading quest panel entry thumbnail: {currentThumbnail}");
            };

            AssetPromiseKeeper_Texture.i.Keep(thumbnailPromise);
        }
        internal void SetIcon(string iconURL)
        {
            if (iconPromise != null)
            {
                iconPromise.ClearEvents();
                AssetPromiseKeeper_Texture.i.Forget(iconPromise);
            }

            if (string.IsNullOrEmpty(iconURL))
            {
                iconImage.gameObject.SetActive(false);
                return;
            }

            iconPromise = new AssetPromise_Texture(iconURL);
            iconPromise.OnSuccessEvent += assetTexture =>
            {
                iconImage.gameObject.SetActive(true);
                iconImage.texture = assetTexture.texture;
            };
            iconPromise.OnFailEvent += assetTexture =>
            {
                iconImage.gameObject.SetActive(false);
                Debug.Log($"Error downloading quest tracker entry icon: {iconURL}");
            };

            AssetPromiseKeeper_Texture.i.Keep(iconPromise);
        }
Exemplo n.º 3
0
 private void ClearThumbnailPromise()
 {
     if (loadedThumbnailPromise != null)
     {
         loadedThumbnailPromise.ClearEvents();
         AssetPromiseKeeper_Texture.i.Forget(loadedThumbnailPromise);
         loadedThumbnailPromise = null;
     }
 }
 private void ClearThumbnailPromise(AssetPromise_Texture thumbnailToClear)
 {
     if (thumbnailToClear != null)
     {
         thumbnailToClear.ClearEvents();
         AssetPromiseKeeper_Texture.i.Forget(thumbnailToClear);
         thumbnailToClear = null;
     }
 }
Exemplo n.º 5
0
        internal void SetIcon(string iconURL)
        {
            if (iconPromise != null)
            {
                iconPromise.ClearEvents();
                AssetPromiseKeeper_Texture.i.Forget(iconPromise);
            }

            if (string.IsNullOrEmpty(iconURL))
            {
                return;
            }

            iconPromise = new AssetPromise_Texture(iconURL);
            iconPromise.OnSuccessEvent += OnIconReady;
            iconPromise.OnFailEvent    += x => { Debug.Log($"Error downloading quest tracker entry icon: {iconURL}"); };

            AssetPromiseKeeper_Texture.i.Keep(iconPromise);
        }
Exemplo n.º 6
0
        internal void SetThumbnail(string thumbnailURL)
        {
            if (thumbnailPromise != null)
            {
                thumbnailPromise.ClearEvents();
                AssetPromiseKeeper_Texture.i.Forget(thumbnailPromise);
            }

            if (string.IsNullOrEmpty(thumbnailURL))
            {
                return;
            }

            thumbnailPromise = new AssetPromise_Texture(thumbnailURL);
            thumbnailPromise.OnSuccessEvent += OnThumbnailReady;
            thumbnailPromise.OnFailEvent    += x => { Debug.LogError($"Error downloading quest panel entry thumbnail: {thumbnailURL}"); };

            AssetPromiseKeeper_Texture.i.Keep(thumbnailPromise);
        }
        internal void SetThumbnail(string thumbnailURL)
        {
            if (thumbnailPromise != null)
            {
                thumbnailPromise.ClearEvents();
                AssetPromiseKeeper_Texture.i.Forget(thumbnailPromise);
            }

            if (string.IsNullOrEmpty(thumbnailURL))
            {
                thumbnailImage.gameObject.SetActive(false);
                return;
            }

            thumbnailPromise = new AssetPromise_Texture(thumbnailURL);
            thumbnailPromise.OnSuccessEvent += OnThumbnailReady;
            thumbnailPromise.OnFailEvent    += x =>
            {
                thumbnailImage.gameObject.SetActive(false);
                Debug.Log($"Error downloading quest panel popup thumbnail: {thumbnailURL}");
            };

            AssetPromiseKeeper_Texture.i.Keep(thumbnailPromise);
        }
        internal void SetImage(string itemImageURL)
        {
            if (imagePromise != null)
            {
                imagePromise.ClearEvents();
                AssetPromiseKeeper_Texture.i.Forget(imagePromise);
            }

            if (string.IsNullOrEmpty(itemImageURL))
            {
                return;
            }

            imagePromise = new AssetPromise_Texture(itemImageURL);
            imagePromise.OnSuccessEvent += OnImageReady;
            imagePromise.OnFailEvent    += x => { Debug.Log($"Error downloading reward image: {itemImageURL}"); };

            AssetPromiseKeeper_Texture.i.Keep(imagePromise);
        }