< Summary

Class:DCL.Components.OnClick
Assembly:MainScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UUIDComponent/OnClick.cs
Covered lines:6
Uncovered lines:2
Coverable lines:8
Total lines:31
Line coverage:75% (6 of 8)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Report(...)0%6.176083.33%
GetClassId()0%2100%
GetEventType()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UUIDComponent/OnClick.cs

#LineLine coverage
 1using UnityEngine;
 2using DCL.Interface;
 3using DCL.Helpers;
 4using DCL.Models;
 5using Ray = UnityEngine.Ray;
 6
 7namespace DCL.Components
 8{
 9    public class OnClick : OnPointerEvent
 10    {
 11        public const string NAME = "onClick";
 12
 13        public override void Report(WebInterface.ACTION_BUTTON buttonId, Ray ray, HitInfo hit)
 14        {
 115            if (!enabled || !IsVisible())
 016                return;
 17
 118            Model model = (Model) this.model;
 19
 120            if (IsAtHoverDistance(hit.distance)
 21                && (model.button == "ANY" || buttonId.ToString() == model.button))
 22            {
 123                DCL.Interface.WebInterface.ReportOnClickEvent(scene.sceneData.id, model.uuid);
 24            }
 125        }
 26
 027        public override int GetClassId() { return (int) CLASS_ID_COMPONENT.UUID_ON_CLICK; }
 28
 1629        public override PointerEventType GetEventType() { return PointerEventType.CLICK; }
 30    }
 31}