Esempio n. 1
0
        public IEnumerator GetAndSetImageSprite()
        {
            if (IsLoadingImage)
            {
                yield break;
            }

            IsLoadingImage = true;
            UnityEngine.Sprite newSprite = null;
            yield return(UnityExtensionMethods.RunOutputCoroutine <UnityEngine.Sprite>(
                             UnityExtensionMethods.CreateAndOutputSpriteFromImageFile(ImageFilePath, ImageWebUrl)
                             , output => newSprite = output));

            if (newSprite != null)
            {
                ImageSprite = newSprite;
            }
            IsLoadingImage = false;
        }