< 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:68
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        internal AssetPromise_AB ownerPromise;
 11
 42412        public override GameObject container { get; set; }
 2013        public Dictionary<Mesh, int> meshToTriangleCount = new Dictionary<Mesh, int>();
 2014        public HashSet<Renderer> renderers = new HashSet<Renderer>();
 2015        public HashSet<Mesh> meshes = new HashSet<Mesh>();
 2016        public HashSet<Material> materials = new HashSet<Material>();
 2017        public HashSet<Texture> textures = new HashSet<Texture>();
 2018        public HashSet<AnimationClip> animationClips = new HashSet<AnimationClip>();
 19        public int totalTriangleCount = 0;
 20        public long animationClipSize = 0;
 21        public long meshDataSize = 0;
 22
 2023        public Asset_AB_GameObject()
 24        {
 2025            container = new GameObject("AB Container");
 26            // Hide gameobject until it's been correctly processed, otherwise it flashes at 0,0,0
 2027            container.transform.position = EnvironmentSettings.MORDOR;
 2028        }
 29
 30        public override object Clone()
 31        {
 3732            Asset_AB_GameObject result = this.MemberwiseClone() as Asset_AB_GameObject;
 3733            result.meshes = new HashSet<Mesh>(meshes);
 3734            result.meshToTriangleCount = new Dictionary<Mesh, int>(meshToTriangleCount);
 3735            result.renderers = new HashSet<Renderer>(renderers);
 3736            result.materials = new HashSet<Material>(materials);
 3737            result.textures = new HashSet<Texture>(textures);
 3738            result.animationClips = new HashSet<AnimationClip>(animationClips);
 3739            return result;
 40        }
 41
 42        public override void Cleanup()
 43        {
 2144            AssetPromiseKeeper_AB.i.Forget(ownerPromise);
 2145            Object.Destroy(container);
 2146        }
 47
 48        public void Show(System.Action OnFinish)
 49        {
 2550            OnFinish?.Invoke();
 2551        }
 52
 53        public void Hide()
 54        {
 155            container.transform.parent = null;
 156            container.transform.position = EnvironmentSettings.MORDOR;
 157        }
 58        public void SetTextures(HashSet<Texture> texturesHashSet)
 59        {
 1260            textures = texturesHashSet;
 61
 4862            for (int i = 0; i < textures.Count; i++)
 63            {
 1264                PerformanceAnalytics.ABTextureTracker.Track();
 65            }
 1266        }
 67    }
 68}