< Summary

Class:UILoadingSpinner
Assembly:Assembly-CSharp
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/UI/ChargeWheel/UILoadingSpinner.cs
Covered lines:15
Uncovered lines:3
Coverable lines:18
Total lines:54
Line coverage:83.3% (15 of 18)
Covered branches:0
Total branches:0

Metrics

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

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    {
 14217        GetMaterial();
 14218    }
 19
 20    void GetMaterial()
 21    {
 14322        if (img.maskable)
 23        {
 14324            _material = img.materialForRendering;
 14325        }
 26        else
 27        {
 028            _material = new Material(img.material);
 029            img.material = _material;
 30        }
 031    }
 32
 33    void Update()
 34    {
 185635        SetValues();
 185636    }
 37
 38
 39    public void SetValues()
 40    {
 185741        if(_material)
 42        {
 185643            _material.SetColor("_color01", color);
 185644            _material.SetFloat("_fillHead", head);
 185645            _material.SetFloat("_fillTail", tail);
 185646        }
 47        else
 48        {
 149            GetMaterial();
 150            SetValues();
 51        }
 52
 153    }
 54}