< 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:28
Uncovered lines:0
Coverable lines:28
Total lines:100
Line coverage:100% (28 of 28)
Covered branches:0
Total branches:0
Covered methods:4
Total methods:4
Method coverage:100% (4 of 4)

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            public readonly bool videoTexture;
 22
 23            public Texture(string src, TextureWrapMode wrapMode, FilterMode filterMode, bool videoTexture = false)
 24            {
 2725                this.src = src;
 2726                this.wrapMode = wrapMode;
 2727                this.filterMode = filterMode;
 2728                this.videoTexture = videoTexture;
 2729            }
 30        }
 31
 32        public readonly bool isPbrMaterial;
 33        public readonly Texture? albedoTexture;
 34        public readonly float alphaTest;
 35        public readonly bool castShadows;
 36
 37        public readonly Texture? alphaTexture;
 38        public readonly Texture? emissiveTexture;
 39        public readonly Texture? bumpTexture;
 40
 41        public readonly Color albedoColor;
 42        public readonly Color diffuseColor;
 43        public readonly Color emissiveColor;
 44        public readonly Color reflectivityColor;
 45
 46        public readonly TransparencyMode transparencyMode;
 47
 48        public readonly float metallic;
 49        public readonly float roughness;
 50
 51        public readonly float specularIntensity;
 52        public readonly float emissiveIntensity;
 53        public readonly float directIntensity;
 54
 55        public static AssetPromise_Material_Model CreateBasicMaterial(Texture? albedoTexture, float alphaTest, Color dif
 56        {
 1957            Color defaultColor = Color.white;
 1958            bool defaultShadow = true;
 1959            return new AssetPromise_Material_Model(false, albedoTexture, null, null, null,
 60                alphaTest, defaultShadow, defaultColor, diffuseColor, defaultColor, defaultColor, TransparencyMode.Auto,
 61                0, 0, 0, 0, 0);
 62        }
 63
 64        public static AssetPromise_Material_Model CreatePBRMaterial(Texture? albedoTexture, Texture? alphaTexture,
 65            Texture? emissiveTexture, Texture? bumpTexture, float alphaTest, bool castShadows, Color albedoColor, Color 
 66            Color reflectivityColor, TransparencyMode transparencyMode, float metallic, float roughness,
 67            float specularIntensity, float emissiveIntensity, float directIntensity)
 68        {
 1969            Color defaultColor = Color.white;
 1970            return new AssetPromise_Material_Model(true, albedoTexture, alphaTexture,
 71                emissiveTexture, bumpTexture, alphaTest, castShadows, albedoColor, defaultColor, emissiveColor,
 72                reflectivityColor, transparencyMode, metallic, roughness,
 73                specularIntensity, emissiveIntensity, directIntensity);
 74        }
 75
 76        public AssetPromise_Material_Model(bool isPbrMaterial, Texture? albedoTexture, Texture? alphaTexture,
 77            Texture? emissiveTexture, Texture? bumpTexture, float alphaTest, bool castShadows, Color albedoColor, Color 
 78            Color reflectivityColor, TransparencyMode transparencyMode, float metallic, float roughness,
 79            float specularIntensity, float emissiveIntensity, float directIntensity)
 80        {
 3881            this.isPbrMaterial = isPbrMaterial;
 3882            this.albedoTexture = albedoTexture;
 3883            this.alphaTexture = alphaTexture;
 3884            this.emissiveTexture = emissiveTexture;
 3885            this.bumpTexture = bumpTexture;
 3886            this.alphaTest = alphaTest;
 3887            this.castShadows = castShadows;
 3888            this.albedoColor = albedoColor;
 3889            this.diffuseColor = diffuseColor;
 3890            this.emissiveColor = emissiveColor;
 3891            this.reflectivityColor = reflectivityColor;
 3892            this.transparencyMode = transparencyMode;
 3893            this.metallic = metallic;
 3894            this.roughness = roughness;
 3895            this.specularIntensity = specularIntensity;
 3896            this.emissiveIntensity = emissiveIntensity;
 3897            this.directIntensity = directIntensity;
 3898        }
 99    }
 100}