public virtual void SetImageTexture(Texture2D texture, bool backgroundEnabled) { if (texture) { image.sprite = TextureUtils.CreateSpriteFromTexture(texture); image.gameObject.SetActive(true); background.enabled = backgroundEnabled; progressSpinner.gameObject.SetActive(false); } }
private void LoadTextureFromWebP(byte[] bytes) { Texture2D texture = Texture2DExt.CreateTexture2DFromWebP(bytes, lMipmaps: true, lLinear: true, lError: out Error lError); if (lError == Error.Success) { _image.sprite = TextureUtils.CreateSpriteFromTexture(texture); } else { Debug.LogError(GetType() + ".LoadTextureFromWebP: WebP Load Error : " + lError.ToString()); } }