< Summary

Class:BIWGizmosAxis
Assembly:BuilderInWorld
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/Scripts/Gizmos/BIWGizmosAxis.cs
Covered lines:9
Uncovered lines:11
Coverable lines:20
Total lines:50
Line coverage:45% (9 of 20)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetGizmo(...)0%2100%
GetGizmo()0%110100%
SetColorHighlight()0%3.192033.33%
SetColorDefault()0%6200%
Start()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/BuilderInWorld/Scripts/Gizmos/BIWGizmosAxis.cs

#LineLine coverage
 1using System.Collections;
 2using System.Collections.Generic;
 3using DCL.Builder;
 4using DCL.Helpers;
 5using UnityEditor;
 6using UnityEngine;
 7
 8public class BIWGizmosAxis : MonoBehaviour, IBIWGizmosAxis
 9{
 10    public Color defaultColor;
 11    public Color highLightColor;
 12    public Renderer objectRenderer;
 13
 14    private MaterialPropertyBlock props;
 15
 16    private IBIWGizmos gizmo = null;
 17
 018    public void SetGizmo(IBIWGizmos parentGizmo) { gizmo = parentGizmo; }
 19
 120    public IBIWGizmos GetGizmo() { return gizmo; }
 821    public Transform axisTransform  => transform;
 22
 23    public void SetColorHighlight()
 24    {
 125        if (props == null)
 126            return;
 27
 028        objectRenderer.GetPropertyBlock(props);
 029        props.SetColor(ShaderUtils.BaseColor, highLightColor);
 030        objectRenderer.SetPropertyBlock(props);
 031    }
 32
 33    public void SetColorDefault()
 34    {
 035        if (props == null)
 036            return;
 37
 038        objectRenderer.GetPropertyBlock(props);
 039        props.SetColor(ShaderUtils.BaseColor, defaultColor);
 040        objectRenderer.SetPropertyBlock(props);
 041    }
 42
 43    private void Start()
 44    {
 345        props = new MaterialPropertyBlock();
 346        objectRenderer.GetPropertyBlock(props);
 347        props.SetColor(ShaderUtils.BaseColor, defaultColor);
 348        objectRenderer.SetPropertyBlock(props);
 349    }
 50}