< Summary

Class:BlurController
Assembly:UIBlur
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/UI/Blur/BlurController.cs
Covered lines:0
Uncovered lines:12
Coverable lines:12
Total lines:41
Line coverage:0% (0 of 12)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
BlurController()0%2100%
Awake()0%2100%
Update()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/UI/Blur/BlurController.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using System.Linq;
 5using UnityEngine.Rendering;
 6using UnityEngine.Rendering.Universal;
 7
 8public class BlurController : MonoBehaviour
 9{
 10    [SerializeField]private UniversalRendererData rendererData = null;
 11    [SerializeField] private string featureName = null;
 12    private ScriptableRendererFeature feature;
 13
 14    [Range(1, 25)]
 015    public int passes = 1;
 16    [Range(1, 10)]
 017    public int downsampling = 1;
 18
 19    public Color color;
 20
 21    private void Awake()
 22    {
 023        feature = rendererData.rendererFeatures.Where((f) => f.name == featureName).FirstOrDefault();
 024    }
 25
 26    void Update()
 27    {
 028        if(feature)
 29        {
 030            var blurFeature = feature as GaussianBlurHandler;
 031            blurFeature.settings.blurPasses = passes;
 032            blurFeature.settings.downsample = downsampling;
 033            blurFeature.settings.blurMaterial.SetColor("_color", color);
 034            rendererData.SetDirty();
 35        }
 36        else
 37        {
 038            feature = rendererData.rendererFeatures.Where((f) => f.name == featureName).FirstOrDefault();
 39        }
 040    }
 41}

Methods/Properties

BlurController()
Awake()
Update()