< Summary

Class:UILoadingSpinner
Assembly:Assembly-CSharp
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Rendering/UI/ChargeWheel/UILoadingSpinner.cs
Covered lines:12
Uncovered lines:6
Coverable lines:18
Total lines:54
Line coverage:66.6% (12 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%2.212062.5%

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    {
 8217        GetMaterial();
 8218    }
 19
 20    void GetMaterial()
 21    {
 8222        if (img.maskable)
 23        {
 8224            _material = img.materialForRendering;
 8225        }
 26        else
 27        {
 028            _material = new Material(img.material);
 029            img.material = _material;
 30        }
 031    }
 32
 33    void Update()
 34    {
 635        SetValues();
 636    }
 37
 38
 39    public void SetValues()
 40    {
 641        if(_material)
 42        {
 643            _material.SetColor("_color01", color);
 644            _material.SetFloat("_fillHead", head);
 645            _material.SetFloat("_fillTail", tail);
 646        }
 47        else
 48        {
 049            GetMaterial();
 050            SetValues();
 51        }
 52
 053    }
 54}