< Summary

Class:DCL.Asset_Gif
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Gif/Asset_Gif.cs
Covered lines:9
Uncovered lines:4
Coverable lines:13
Total lines:37
Line coverage:69.2% (9 of 13)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Dispose()0%2100%
Cleanup()0%550100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Gif/Asset_Gif.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL
 4{
 5    public class Asset_Gif : Asset, ITexture
 6    {
 7        public event System.Action OnCleanup;
 8
 49        public Texture2D texture => frames?[0].texture;
 010        public int width => texture?.width ?? 0;
 011        public int height => texture?.height ?? 0;
 012        public GifFrameData[] frames { get; internal set; }
 13
 14        internal GifProcessor processor;
 15
 016        public void Dispose() { Cleanup(); }
 17
 18        public override void Cleanup()
 19        {
 1020            OnCleanup?.Invoke();
 21
 1022            processor?.DisposeGif();
 23
 1024            if (frames is null)
 25            {
 626                return;
 27            }
 28
 36829            for (int i = 0; i < frames.Length; i++)
 30            {
 18031                Object.Destroy(frames[i].texture);
 32            }
 33
 434            frames = null;
 435        }
 36    }
 37}