< Summary

Class:GDX.Rendering.ShaderProvider
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Rendering/ShaderProvider.cs
Covered lines:18
Uncovered lines:0
Coverable lines:18
Total lines:70
Line coverage:100% (18 of 18)
Covered branches:0
Total branches:0
Covered methods:4
Total methods:4
Method coverage:100% (4 of 4)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
ShaderProvider()0%110100%
GetProvidedShaders()0%110100%

File(s)

./Packages/com.dotbunny.gdx/GDX/Rendering/ShaderProvider.cs

#LineLine coverage
 1// Copyright (c) 2020-2023 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5using UnityEngine;
 6
 7namespace GDX.Rendering
 8{
 9    /// <summary>
 10    ///     A provider of GDX built-in shader references and properties.
 11    /// </summary>
 12    public static class ShaderProvider
 13    {
 14        /// <summary>
 15        ///     The cached reference to the dotted line shader.
 16        /// </summary>
 17        static Shader s_DottedLineShader;
 18
 19        /// <summary>
 20        ///     The cached reference to the unlit colored shader.
 21        /// </summary>
 22        static Shader s_UnlitColorShader;
 23
 24        /// <summary>
 25        ///     The cached "_Color" property ID.
 26        /// </summary>
 227        public static readonly int ColorPropertyID = Shader.PropertyToID("_Color");
 28
 29        /// <summary>
 30        ///     A reference to a clip-space sin wave discard based shader, which cheaply provides a dotted line effect.
 31        /// </summary>
 32        public static Shader DottedLine
 33        {
 34            get
 435            {
 436                if (s_DottedLineShader == null)
 237                {
 238                    s_DottedLineShader = Shader.Find("GDX/DottedLine");
 239                }
 40
 441                return s_DottedLineShader;
 442            }
 43        }
 44
 45        /// <summary>
 46        ///     A reference to a unlit single color shader.
 47        /// </summary>
 48        public static Shader UnlitColor
 49        {
 50            get
 451            {
 452                if (s_UnlitColorShader == null)
 253                {
 254                    s_UnlitColorShader = Shader.Find("GDX/UnlitColor");
 255                }
 56
 457                return s_UnlitColorShader;
 458            }
 59        }
 60
 61        /// <summary>
 62        ///     Get all shaders which <see cref="ShaderProvider"/> is aware of.
 63        /// </summary>
 64        /// <returns>An array of the known shaders to <see cref="ShaderProvider"/>.</returns>
 65        public static Shader[] GetProvidedShaders()
 266        {
 267            return new[] { DottedLine, UnlitColor };
 268        }
 69    }
 70}

Coverage by test methods





Methods/Properties

ShaderProvider()
DottedLine()
UnlitColor()
GetProvidedShaders()