static public IEnumerator Create(string contentType, byte[] bytes, Action <IWrappedTextureAsset> OnSuccess) { if (contentType == "image/gif") { var gif = new DCLGif(); yield return(gif.Load(bytes, () => { gif.Play(); OnSuccess?.Invoke(new WrappedGif(gif)); })); } else { var texture = new Texture2D(1, 1); texture.LoadImage(bytes); OnSuccess?.Invoke(new WrappedImage(texture)); } }
public WrappedGif(DCLGif gif) { this.gif = gif; }