< 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:31
Uncovered lines:0
Coverable lines:31
Total lines:70
Line coverage:100% (31 of 31)
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%
SetTextures(...)0%220100%

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 MainScripts.DCL.Analytics.PerformanceAnalytics;
 4using UnityEngine;
 5
 6namespace DCL
 7{
 8    public class Asset_AB_GameObject : Asset_WithPoolableContainer
 9    {
 10        private const string CONTAINER_GO_NAME = "AB Container";
 11
 12        internal AssetPromise_AB ownerPromise;
 13
 42414        public override GameObject container { get; set; }
 2015        public Dictionary<Mesh, int> meshToTriangleCount = new Dictionary<Mesh, int>();
 2016        public HashSet<Renderer> renderers = new HashSet<Renderer>();
 2017        public HashSet<Mesh> meshes = new HashSet<Mesh>();
 2018        public HashSet<Material> materials = new HashSet<Material>();
 2019        public HashSet<Texture> textures = new HashSet<Texture>();
 2020        public HashSet<AnimationClip> animationClips = new HashSet<AnimationClip>();
 21        public int totalTriangleCount = 0;
 22        public long animationClipSize = 0;
 23        public long meshDataSize = 0;
 24
 2025        public Asset_AB_GameObject()
 26        {
 2027            container = new GameObject(CONTAINER_GO_NAME);
 28            // Hide gameobject until it's been correctly processed, otherwise it flashes at 0,0,0
 2029            container.transform.position = EnvironmentSettings.MORDOR;
 2030        }
 31
 32        public override object Clone()
 33        {
 3734            Asset_AB_GameObject result = this.MemberwiseClone() as Asset_AB_GameObject;
 3735            result.meshes = new HashSet<Mesh>(meshes);
 3736            result.meshToTriangleCount = new Dictionary<Mesh, int>(meshToTriangleCount);
 3737            result.renderers = new HashSet<Renderer>(renderers);
 3738            result.materials = new HashSet<Material>(materials);
 3739            result.textures = new HashSet<Texture>(textures);
 3740            result.animationClips = new HashSet<AnimationClip>(animationClips);
 3741            return result;
 42        }
 43
 44        public override void Cleanup()
 45        {
 2146            AssetPromiseKeeper_AB.i.Forget(ownerPromise);
 2147            Object.Destroy(container);
 2148        }
 49
 50        public void Show(System.Action OnFinish)
 51        {
 2552            OnFinish?.Invoke();
 2553        }
 54
 55        public void Hide()
 56        {
 157            container.transform.parent = null;
 158            container.transform.position = EnvironmentSettings.MORDOR;
 159        }
 60        public void SetTextures(HashSet<Texture> texturesHashSet)
 61        {
 1262            textures = texturesHashSet;
 63
 4864            for (int i = 0; i < textures.Count; i++)
 65            {
 1266                PerformanceAnalytics.ABTextureTracker.Track();
 67            }
 1268        }
 69    }
 70}