< 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:38
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 IGifProcessor processor;
 15
 016        public void Dispose() { Cleanup(); }
 17
 18        public override void Cleanup()
 19        {
 1420            OnCleanup?.Invoke();
 21
 1422            processor?.DisposeGif();
 23
 1424            if (frames is null)
 25            {
 926                return;
 27            }
 28
 46029            for (int i = 0; i < frames.Length; i++)
 30            {
 22531                Object.Destroy(frames[i].texture);
 32            }
 33
 534            frames = null;
 535        }
 36    }
 37
 38}