< Summary

Class:DCL.Asset_AB_GameObject
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/AssetBundles/AB_GameObject/Asset_AB_GameObject.cs
Covered lines:25
Uncovered lines:0
Coverable lines:25
Total lines:55
Line coverage:100% (25 of 25)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Asset_AB_GameObject()0%110100%
Clone()0%110100%
Cleanup()0%110100%
Show(...)0%220100%
Hide()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/AssetBundles/AB_GameObject/Asset_AB_GameObject.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using DCL.Configuration;
 3using UnityEngine;
 4
 5namespace DCL
 6{
 7    public class Asset_AB_GameObject : Asset_WithPoolableContainer
 8    {
 9        internal AssetPromise_AB ownerPromise;
 10
 43511        public override GameObject container { get; set; }
 1712        public Dictionary<Mesh, int> meshToTriangleCount = new Dictionary<Mesh, int>();
 1713        public HashSet<Renderer> renderers = new HashSet<Renderer>();
 1714        public HashSet<Mesh> meshes = new HashSet<Mesh>();
 1715        public HashSet<Material> materials = new HashSet<Material>();
 1716        public HashSet<Texture> textures = new HashSet<Texture>();
 17        public int totalTriangleCount = 0;
 18
 1719        public Asset_AB_GameObject()
 20        {
 1721            container = new GameObject("AB Container");
 22            // Hide gameobject until it's been correctly processed, otherwise it flashes at 0,0,0
 1723            container.transform.position = EnvironmentSettings.MORDOR;
 1724        }
 25
 26        public override object Clone()
 27        {
 3628            Asset_AB_GameObject result = this.MemberwiseClone() as Asset_AB_GameObject;
 3629            result.meshes = new HashSet<Mesh>(meshes);
 3630            result.meshToTriangleCount = new Dictionary<Mesh, int>(meshToTriangleCount);
 3631            result.renderers = new HashSet<Renderer>(renderers);
 3632            result.materials = new HashSet<Material>(materials);
 3633            result.textures = new HashSet<Texture>(textures);
 3634            return result;
 35        }
 36
 37
 38        public override void Cleanup()
 39        {
 1840            AssetPromiseKeeper_AB.i.Forget(ownerPromise);
 1841            Object.Destroy(container);
 1842        }
 43
 44        public void Show(System.Action OnFinish)
 45        {
 2546            OnFinish?.Invoke();
 2547        }
 48
 49        public void Hide()
 50        {
 151            container.transform.parent = null;
 152            container.transform.position = EnvironmentSettings.MORDOR;
 153        }
 54    }
 55}