< Summary

Class:DCL.GLTFast.Wrappers.GltfTextureDownloaderWrapper
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/GLTFast/Wrappers/GLTFTextureDownloaderWrapper.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:48
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
GltfTextureDownloaderWrapper(...)0%2100%
MoveNext()0%2100%
Dispose()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/GLTFast/Wrappers/GLTFTextureDownloaderWrapper.cs

#LineLine coverage
 1using System;
 2using GLTFast.Loading;
 3using UnityEngine;
 4using UnityEngine.Networking;
 5
 6namespace DCL.GLTFast.Wrappers
 7{
 8    internal class GltfTextureDownloaderWrapper : ITextureDownload
 9    {
 10        private readonly WebRequestAsyncOperation asyncOp;
 11
 012        public GltfTextureDownloaderWrapper(WebRequestAsyncOperation asyncOp)
 13        {
 014            this.asyncOp = asyncOp;
 015        }
 16
 017        public bool success => asyncOp.isSucceded;
 018        public string error => asyncOp.webRequest.error;
 019        public byte[] data => asyncOp.webRequest.downloadHandler.data;
 020        public string text => asyncOp.webRequest.downloadHandler.text;
 021        public bool? isBinary => true;
 22
 23        public bool MoveNext() =>
 024            asyncOp.MoveNext();
 25
 26        public Texture2D texture
 27        {
 28            get
 29            {
 30                Texture2D texture2D;
 31
 032                if (asyncOp.webRequest.downloadHandler is DownloadHandlerTexture downloadHandlerTexture) { texture2D = d
 033                else { return null; }
 34
 35#if UNITY_WEBGL
 036                texture2D.Compress(false);
 37#endif
 38
 039                return texture2D;
 40            }
 41        }
 42
 43        public void Dispose()
 44        {
 045            asyncOp.Dispose();
 046        }
 47    }
 48}