< Summary

Class:MainScripts.DCL.AssetsEmbedment.Editor.EmbeddedTextureProcessor
Assembly:AssetsEmbedmentEditor
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/AssetsEmbedment/Editor/EmbeddedTextureProcessor.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:26
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
EmbeddedTextureProcessor()0%12300%
OnPreprocessTexture()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/AssetsEmbedment/Editor/EmbeddedTextureProcessor.cs

#LineLine coverage
 1using UnityEditor;
 2using UnityEngine;
 3
 4namespace MainScripts.DCL.AssetsEmbedment.Editor
 5{
 6    public class EmbeddedTextureProcessor : AssetPostprocessor
 7    {
 8        private static string texturesPathCached;
 9
 010        private static string texturesPath =
 11            texturesPathCached ??= TextureEmbedder.texturesPath.StartsWith(Application.dataPath)
 12                ? TextureEmbedder.texturesPath.Remove(0, Application.dataPath.Length)
 13                : TextureEmbedder.texturesPath;
 14
 15        private void OnPreprocessTexture()
 16        {
 017            if (assetPath.Contains(texturesPath))
 18            {
 019                var texImporter = (TextureImporter)assetImporter;
 020                texImporter.isReadable = true;
 021                texImporter.alphaIsTransparency = true;
 022                texImporter.mipmapEnabled = false;
 23            }
 024        }
 25    }
 26}