public void OnGUI() { if (gif != null) { gif.Draw(5, 5); } }
/// <summary> /// Draws the GIF. /// </summary> /// <param name="rect">The rect.</param> /// <param name="gif">The GIF.</param> public static bool DrawGIF(Rect rect, UniGif.GifFile gif) { if (gif == null) { throw new ArgumentNullException(nameof(gif), "Null gif!"); } return(gif.Draw(rect)); }
/// <summary> /// Draws a GIF. /// </summary> /// <param name="gif">The GIF.</param> public static void DrawGIF(UniGif.GifFile gif) { var texture = gif.GetFirstFrame(); if (texture == null) { Debug.LogWarning("Null texture passed!"); return; } var rect = GetRectForTexture(texture); rect = rect.ForceBoth(texture.width, texture.height); gif.Draw(rect); }