< Summary

Class:UILoadingSpinner
Assembly:RenderingUIScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/UI/ChargeWheel/UILoadingSpinner.cs
Covered lines:10
Uncovered lines:6
Coverable lines:16
Total lines:54
Line coverage:62.5% (10 of 16)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Start()0%110100%
GetMaterial()0%2.862040%
Update()0%110100%
SetValues()0%2.312057.14%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/UI/ChargeWheel/UILoadingSpinner.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using UnityEngine;
 4using UnityEngine.UI;
 5
 6public class UILoadingSpinner : MonoBehaviour
 7{
 8    Material _material;
 9    public Image img;
 10
 11    public Color color;
 12    public float head;
 13    public float tail;
 14
 15    void Start()
 16    {
 18817        GetMaterial();
 18818    }
 19
 20    void GetMaterial()
 21    {
 18822        if (img.maskable)
 23        {
 18824            _material = img.materialForRendering;
 25        }
 26        else
 27        {
 028            _material = new Material(img.material);
 029            img.material = _material;
 30        }
 031    }
 32
 33    void Update()
 34    {
 1417135        SetValues();
 1417136    }
 37
 38
 39    public void SetValues()
 40    {
 1417141        if(_material)
 42        {
 1417143            _material.SetColor("_color01", color);
 1417144            _material.SetFloat("_fillHead", head);
 1417145            _material.SetFloat("_fillTail", tail);
 46        }
 47        else
 48        {
 049            GetMaterial();
 050            SetValues();
 51        }
 52
 053    }
 54}