< Summary

Class:DCL.Asset_Texture
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Texture/Asset_Texture.cs
Covered lines:12
Uncovered lines:5
Coverable lines:17
Total lines:40
Line coverage:70.5% (12 of 17)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Asset_Texture()0%110100%
ConfigureTexture(...)0%3.023087.5%
Cleanup()0%220100%
Dispose()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Texture/Asset_Texture.cs

#LineLine coverage
 1using UnityEngine;
 2using UnityGLTF.Cache;
 3using Object = UnityEngine.Object;
 4
 5namespace DCL
 6{
 7    public class Asset_Texture : Asset, ITexture
 8    {
 09        public Texture2D texture { get; set; }
 13510        public float resizingFactor = 1;
 11        public Asset_Texture dependencyAsset; // to store the default tex asset and release it accordingly
 12        public event System.Action OnCleanup;
 13
 14        public void ConfigureTexture(TextureWrapMode textureWrapMode, FilterMode textureFilterMode, bool makeNoLongerRea
 15        {
 7016            if (texture == null)
 217                return;
 18
 6819            texture.wrapMode = textureWrapMode;
 6820            texture.filterMode = textureFilterMode;
 21
 6822            if (DataStore.i.textureConfig.runCompression.Get())
 023                texture.Compress(false);
 24
 6825            texture.Apply(textureFilterMode != FilterMode.Point, makeNoLongerReadable);
 6826        }
 27
 28        public override void Cleanup()
 29        {
 14130            OnCleanup?.Invoke();
 14131            PersistentAssetCache.RemoveImage(texture);
 14132            Object.Destroy(texture);
 14133        }
 34
 035        public void Dispose() { Cleanup(); }
 36
 037        public int width => texture.width;
 038        public int height => texture.height;
 39    }
 40}