< 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:24
Uncovered lines:0
Coverable lines:24
Total lines:94
Line coverage:100% (24 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%110100%
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            {
 2724                this.src = src;
 2725                this.wrapMode = wrapMode;
 2726                this.filterMode = filterMode;
 2727            }
 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        {
 1954            Color defaultColor = Color.white;
 1955            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        {
 1965            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        {
 3876            this.isPbrMaterial = isPbrMaterial;
 3877            this.albedoTexture = albedoTexture;
 3878            this.alphaTexture = alphaTexture;
 3879            this.emissiveTexture = emissiveTexture;
 3880            this.bumpTexture = bumpTexture;
 3881            this.alphaTest = alphaTest;
 3882            this.albedoColor = albedoColor;
 3883            this.emissiveColor = emissiveColor;
 3884            this.reflectivityColor = reflectivityColor;
 3885            this.transparencyMode = transparencyMode;
 3886            this.metallic = metallic;
 3887            this.roughness = roughness;
 3888            this.glossiness = glossiness;
 3889            this.specularIntensity = specularIntensity;
 3890            this.emissiveIntensity = emissiveIntensity;
 3891            this.directIntensity = directIntensity;
 3892        }
 93    }
 94}