< Summary

Class:DCL.AssetPromise_Material_Model
Assembly:AssetPromiseKeeper
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Material/AssetPromise_Material_Model.cs
Covered lines:23
Uncovered lines:1
Coverable lines:24
Total lines:94
Line coverage:95.8% (23 of 24)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Texture(...)0%110100%
CreateBasicMaterial(...)0%110100%
CreatePBRMaterial(...)0%2100%
AssetPromise_Material_Model(...)0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/AssetManager/Material/AssetPromise_Material_Model.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCL
 4{
 5    public readonly struct AssetPromise_Material_Model
 6    {
 7        public enum TransparencyMode
 8        {
 9            Opaque = 0,
 10            AlphaTest = 1,
 11            AlphaBlend = 2,
 12            AlphaTestAndAlphaBlend = 3,
 13            Auto = 4
 14        }
 15
 16        public readonly struct Texture
 17        {
 18            public readonly string src;
 19            public readonly TextureWrapMode wrapMode;
 20            public readonly FilterMode filterMode;
 21
 22            public Texture(string src, TextureWrapMode wrapMode, FilterMode filterMode)
 23            {
 2624                this.src = src;
 2625                this.wrapMode = wrapMode;
 2626                this.filterMode = filterMode;
 2627            }
 28        }
 29
 30        public readonly bool isPbrMaterial;
 31        public readonly Texture? albedoTexture;
 32        public readonly float alphaTest;
 33
 34        public readonly Texture? alphaTexture;
 35        public readonly Texture? emissiveTexture;
 36        public readonly Texture? bumpTexture;
 37
 38        public readonly Color albedoColor;
 39        public readonly Color emissiveColor;
 40        public readonly Color reflectivityColor;
 41
 42        public readonly TransparencyMode transparencyMode;
 43
 44        public readonly float metallic;
 45        public readonly float roughness;
 46        public readonly float glossiness;
 47
 48        public readonly float specularIntensity;
 49        public readonly float emissiveIntensity;
 50        public readonly float directIntensity;
 51
 52        public static AssetPromise_Material_Model CreateBasicMaterial(Texture? albedoTexture, float alphaTest)
 53        {
 2854            Color defaultColor = Color.white;
 2855            return new AssetPromise_Material_Model(false, albedoTexture, null, null, null,
 56                alphaTest, defaultColor, defaultColor, defaultColor, TransparencyMode.Auto,
 57                0, 0, 0, 0, 0, 0);
 58        }
 59
 60        public static AssetPromise_Material_Model CreatePBRMaterial(Texture? albedoTexture, Texture? alphaTexture,
 61            Texture? emissiveTexture, Texture? bumpTexture, float alphaTest, Color albedoColor, Color emissiveColor,
 62            Color reflectivityColor, TransparencyMode transparencyMode, float metallic, float roughness, float glossines
 63            float specularIntensity, float emissiveIntensity, float directIntensity)
 64        {
 065            return new AssetPromise_Material_Model(true, albedoTexture, alphaTexture,
 66                emissiveTexture, bumpTexture, alphaTest, albedoColor, emissiveColor,
 67                reflectivityColor, transparencyMode, metallic, roughness, glossiness,
 68                specularIntensity, emissiveIntensity, directIntensity);
 69        }
 70
 71        public AssetPromise_Material_Model(bool isPbrMaterial, Texture? albedoTexture, Texture? alphaTexture,
 72            Texture? emissiveTexture, Texture? bumpTexture, float alphaTest, Color albedoColor, Color emissiveColor,
 73            Color reflectivityColor, TransparencyMode transparencyMode, float metallic, float roughness, float glossines
 74            float specularIntensity, float emissiveIntensity, float directIntensity)
 75        {
 2876            this.isPbrMaterial = isPbrMaterial;
 2877            this.albedoTexture = albedoTexture;
 2878            this.alphaTexture = alphaTexture;
 2879            this.emissiveTexture = emissiveTexture;
 2880            this.bumpTexture = bumpTexture;
 2881            this.alphaTest = alphaTest;
 2882            this.albedoColor = albedoColor;
 2883            this.emissiveColor = emissiveColor;
 2884            this.reflectivityColor = reflectivityColor;
 2885            this.transparencyMode = transparencyMode;
 2886            this.metallic = metallic;
 2887            this.roughness = roughness;
 2888            this.glossiness = glossiness;
 2889            this.specularIntensity = specularIntensity;
 2890            this.emissiveIntensity = emissiveIntensity;
 2891            this.directIntensity = directIntensity;
 2892        }
 93    }
 94}