< Summary

Class:DCL.Components.OnPointerDown
Assembly:MainScripts
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Components/UUIDComponent/OnPointerDown.cs
Covered lines:9
Uncovered lines:2
Coverable lines:11
Total lines:40
Line coverage:81.8% (9 of 11)
Covered branches:0
Total branches:0

Metrics

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

File(s)

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

#LineLine coverage
 1using DCL.Interface;
 2using DCL.Helpers;
 3using DCL.Models;
 4using Ray = UnityEngine.Ray;
 5
 6namespace DCL.Components
 7{
 8    public class OnPointerDown : OnPointerEvent
 9    {
 10        public const string NAME = "pointerDown";
 11
 12        public override void Report(WebInterface.ACTION_BUTTON buttonId, Ray ray, HitInfo hit)
 13        {
 414            if (!enabled || !IsVisible())
 015                return;
 16
 417            Model model = this.model as OnPointerEvent.Model;
 18
 419            if (ShouldReportEvent(buttonId, hit))
 20            {
 421                string meshName = pointerEventHandler.GetMeshName(hit.collider);
 22
 423                DCL.Interface.WebInterface.ReportOnPointerDownEvent(buttonId, scene.sceneData.id, model.uuid, entity.ent
 24            }
 425        }
 26
 27        public bool ShouldReportEvent(WebInterface.ACTION_BUTTON buttonId, HitInfo hit)
 28        {
 429            Model model = this.model as Model;
 30
 431            return IsVisible() &&
 32                   IsAtHoverDistance(hit.distance) &&
 33                   (model.button == "ANY" || buttonId.ToString() == model.button);
 34        }
 35
 036        public override int GetClassId() { return (int) CLASS_ID_COMPONENT.UUID_ON_DOWN; }
 37
 9538        public override PointerEventType GetEventType() { return PointerEventType.DOWN; }
 39    }
 40}