< Summary

Class:DCL.Components.OnClick
Assembly:DCL.Components.Events
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/UUIDEventComponentsPlugin/UUIDComponent/OnClick.cs
Covered lines:7
Uncovered lines:1
Coverable lines:8
Total lines:38
Line coverage:87.5% (7 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%110100%
GetEventType()0%110100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLPlugins/UUIDEventComponentsPlugin/UUIDComponent/OnClick.cs

#LineLine coverage
 1using UnityEngine;
 2using DCL.Interface;
 3using DCL.Helpers;
 4using DCL.Models;
 5using DCLPlugins.UUIDEventComponentsPlugin.UUIDComponent.Interfaces;
 6using Ray = UnityEngine.Ray;
 7
 8namespace DCL.Components
 9{
 10    public class OnClick : OnPointerEvent
 11    {
 12        public const string NAME = "onClick";
 13
 14        public override void Report(WebInterface.ACTION_BUTTON buttonId, Ray ray, HitInfo hit)
 15        {
 116            if (!enabled || !IsVisible())
 017                return;
 18
 119            Model model = (Model) this.model;
 20
 121            if (IsAtHoverDistance(hit.distance)
 22                && (model.button == "ANY" || buttonId.ToString() == model.button))
 23            {
 124                DCL.Interface.WebInterface.ReportOnClickEvent(scene.sceneData.sceneNumber, model.uuid);
 25            }
 126        }
 27
 28        public override int GetClassId()
 29        {
 130            return (int) CLASS_ID_COMPONENT.UUID_ON_CLICK;
 31        }
 32
 33        public override PointerInputEventType GetEventType()
 34        {
 335            return PointerInputEventType.CLICK;
 36        }
 37    }
 38}