< Summary

Class:DCL.Asset_AB
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/AssetBundles/AB/Asset_AB.cs
Covered lines:22
Uncovered lines:1
Coverable lines:23
Total lines:64
Line coverage:95.6% (22 of 23)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Asset_AB()0%110100%
Clone()0%2100%
CancelShow()0%110100%
Cleanup()0%220100%
GetAssetsByExtensions[T](...)0%550100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/AssetBundles/AB/Asset_AB.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using UnityEngine;
 3
 4namespace DCL
 5{
 6    public class Asset_AB : Asset
 7    {
 8        public AssetBundle ownerAssetBundle;
 9        public string assetBundleAssetName;
 10
 2411        public Dictionary<string, List<Object>> assetsByExtension = new Dictionary<string, List<Object>>();
 12
 2413        public Asset_AB()
 14        {
 2415            assetsByExtension = new Dictionary<string, List<Object>>();
 2416        }
 17
 018        public override object Clone() => (Asset_AB) MemberwiseClone();
 19
 20        public void CancelShow()
 21        {
 722            Cleanup();
 723        }
 24
 25        public override void Cleanup()
 26        {
 3127            assetsByExtension = null;
 28
 3129            if (ownerAssetBundle)
 30            {
 1731                ownerAssetBundle.Unload(true);
 1732                ownerAssetBundle = null;
 33            }
 3134        }
 35
 36        public List<T> GetAssetsByExtensions<T>(params string[] extensions)
 37            where T : Object
 38        {
 1239            var goList = new List<T>();
 40
 7241            for (int i1 = 0; i1 < extensions.Length; i1++)
 42            {
 2443                string ext = extensions[i1];
 44                List<Object> assets;
 45
 2446                if (assetsByExtension.ContainsKey(ext))
 47                {
 1148                    assets = assetsByExtension[ext];
 1149                    int glbCount = assets.Count;
 50
 4451                    for (int i = 0; i < glbCount; i++)
 52                    {
 1153                        Object go = assets[i];
 54
 1155                        if (go is T)
 1156                            goList.Add((T) go);
 57                    }
 58                }
 59            }
 60
 1261            return goList;
 62        }
 63    }
 64}