< 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
 2711        public Dictionary<string, List<Object>> assetsByExtension = new Dictionary<string, List<Object>>();
 12
 2713        public Asset_AB()
 14        {
 2715            assetsByExtension = new Dictionary<string, List<Object>>();
 2716        }
 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        {
 3427            assetsByExtension = null;
 28
 3429            if (ownerAssetBundle)
 30            {
 2031                ownerAssetBundle.Unload(true);
 2032                ownerAssetBundle = null;
 33            }
 3434        }
 35
 36        public List<T> GetAssetsByExtensions<T>(params string[] extensions)
 37            where T : Object
 38        {
 1339            var goList = new List<T>();
 40
 7841            for (int i1 = 0; i1 < extensions.Length; i1++)
 42            {
 2643                string ext = extensions[i1];
 44                List<Object> assets;
 45
 2646                if (assetsByExtension.ContainsKey(ext))
 47                {
 1248                    assets = assetsByExtension[ext];
 1249                    int glbCount = assets.Count;
 50
 4851                    for (int i = 0; i < glbCount; i++)
 52                    {
 1253                        Object go = assets[i];
 54
 1255                        if (go is T)
 1256                            goList.Add((T) go);
 57                    }
 58                }
 59            }
 60
 1361            return goList;
 62        }
 63    }
 64}