< 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:27
Uncovered lines:0
Coverable lines:27
Total lines:99
Line coverage:100% (27 of 27)
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            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 emissiveColor;
 43        public readonly Color reflectivityColor;
 44
 45        public readonly TransparencyMode transparencyMode;
 46
 47        public readonly float metallic;
 48        public readonly float roughness;
 49        public readonly float glossiness;
 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)
 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, defaultColor, defaultColor, TransparencyMode.Auto,
 61                0, 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, float glossines
 67            float specularIntensity, float emissiveIntensity, float directIntensity)
 68        {
 1969            return new AssetPromise_Material_Model(true, albedoTexture, alphaTexture,
 70                emissiveTexture, bumpTexture, alphaTest, castShadows, albedoColor, emissiveColor,
 71                reflectivityColor, transparencyMode, metallic, roughness, glossiness,
 72                specularIntensity, emissiveIntensity, directIntensity);
 73        }
 74
 75        public AssetPromise_Material_Model(bool isPbrMaterial, Texture? albedoTexture, Texture? alphaTexture,
 76            Texture? emissiveTexture, Texture? bumpTexture, float alphaTest, bool castShadows, Color albedoColor, Color 
 77            Color reflectivityColor, TransparencyMode transparencyMode, float metallic, float roughness, float glossines
 78            float specularIntensity, float emissiveIntensity, float directIntensity)
 79        {
 3880            this.isPbrMaterial = isPbrMaterial;
 3881            this.albedoTexture = albedoTexture;
 3882            this.alphaTexture = alphaTexture;
 3883            this.emissiveTexture = emissiveTexture;
 3884            this.bumpTexture = bumpTexture;
 3885            this.alphaTest = alphaTest;
 3886            this.castShadows = castShadows;
 3887            this.albedoColor = albedoColor;
 3888            this.emissiveColor = emissiveColor;
 3889            this.reflectivityColor = reflectivityColor;
 3890            this.transparencyMode = transparencyMode;
 3891            this.metallic = metallic;
 3892            this.roughness = roughness;
 3893            this.glossiness = glossiness;
 3894            this.specularIntensity = specularIntensity;
 3895            this.emissiveIntensity = emissiveIntensity;
 3896            this.directIntensity = directIntensity;
 3897        }
 98    }
 99}