< 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:57
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        public long animationClipSize = 0;
 19        public long meshDataSize = 0;
 20
 1721        public Asset_AB_GameObject()
 22        {
 1723            container = new GameObject("AB Container");
 24            // Hide gameobject until it's been correctly processed, otherwise it flashes at 0,0,0
 1725            container.transform.position = EnvironmentSettings.MORDOR;
 1726        }
 27
 28        public override object Clone()
 29        {
 3630            Asset_AB_GameObject result = this.MemberwiseClone() as Asset_AB_GameObject;
 3631            result.meshes = new HashSet<Mesh>(meshes);
 3632            result.meshToTriangleCount = new Dictionary<Mesh, int>(meshToTriangleCount);
 3633            result.renderers = new HashSet<Renderer>(renderers);
 3634            result.materials = new HashSet<Material>(materials);
 3635            result.textures = new HashSet<Texture>(textures);
 3636            return result;
 37        }
 38
 39
 40        public override void Cleanup()
 41        {
 1842            AssetPromiseKeeper_AB.i.Forget(ownerPromise);
 1843            Object.Destroy(container);
 1844        }
 45
 46        public void Show(System.Action OnFinish)
 47        {
 2548            OnFinish?.Invoke();
 2549        }
 50
 51        public void Hide()
 52        {
 153            container.transform.parent = null;
 154            container.transform.position = EnvironmentSettings.MORDOR;
 155        }
 56    }
 57}