< Summary

Class:DCL.AssetPromiseSettings_Rendering
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Common/AssetPromiseSettings_Rendering.cs
Covered lines:20
Uncovered lines:0
Coverable lines:20
Total lines:69
Line coverage:100% (20 of 20)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
AssetPromiseSettings_Rendering()0%110100%
ApplyBeforeLoad(...)0%660100%
ApplyAfterLoad(...)0%110100%
ApplyAfterLoad(...)0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Common/AssetPromiseSettings_Rendering.cs

#LineLine coverage
 1using DCL.Helpers;
 2using System.Collections.Generic;
 3using UnityEngine;
 4
 5namespace DCL
 6{
 7    public class AssetPromiseSettings_Rendering : IAssetPromiseSettings<Transform>
 8    {
 9        public enum VisibleFlags
 10        {
 11            INVISIBLE,
 12            VISIBLE_WITHOUT_TRANSITION,
 13            VISIBLE_WITH_TRANSITION
 14        }
 15
 45516        public VisibleFlags visibleFlags = VisibleFlags.VISIBLE_WITH_TRANSITION;
 45517        public MaterialCachingHelper.Mode cachingFlags = MaterialCachingHelper.Mode.CACHE_EVERYTHING;
 18        public Shader shaderOverride;
 19
 20        public Transform parent;
 21        public Vector3? initialLocalPosition;
 22        public Quaternion? initialLocalRotation;
 23        public Vector3? initialLocalScale;
 24        public int? layer;
 25
 26        public bool forceNewInstance;
 27        public bool forceGPUOnlyMesh = false;
 28
 29        public void ApplyBeforeLoad(Transform t)
 30        {
 38031            if (parent != null)
 32            {
 25033                t.SetParent(parent, false);
 25034                t.ResetLocalTRS();
 35            }
 36
 38037            if (initialLocalPosition.HasValue)
 38            {
 9539                t.localPosition = initialLocalPosition.Value;
 40            }
 41
 38042            if (initialLocalRotation.HasValue)
 43            {
 444                t.localRotation = initialLocalRotation.Value;
 45            }
 46
 38047            if (initialLocalScale.HasValue)
 48            {
 449                t.localScale = initialLocalScale.Value;
 50            }
 51
 38052            if (layer.HasValue)
 9153                Utils.SetLayerRecursively(t, layer.Value);
 38054        }
 55
 7256        public void ApplyAfterLoad(Transform transform) { ApplyAfterLoad(new List<Renderer>(transform.GetComponentsInChi
 57
 58        public void ApplyAfterLoad(List<Renderer> renderers = null)
 59        {
 16460            int renderersCount = renderers.Count;
 61
 110862            for (int i = 0; i < renderersCount; i++)
 63            {
 39064                Renderer renderer = renderers[i];
 39065                renderer.enabled = visibleFlags != VisibleFlags.INVISIBLE;
 66            }
 16467        }
 68    }
 69}