Ejemplo n.º 1
0
 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));
     }
 }
Ejemplo n.º 2
0
 public WrappedGif(DCLGif gif)
 {
     this.gif = gif;
 }